Cette page est affichée en anglais. Une traduction française est en cours.
ConfigsJul 20, 2026·3 min de lecture

FTXUI — Functional Terminal User Interface Library for C++

A modern C++ library for building interactive terminal UIs with a functional and declarative API. Supports animations, flexbox-style layouts, and works across platforms without external dependencies.

Prêt pour agents

Installation agent prête

Cet actif peut être installé après choix du runtime, vérification du plan et exécution de la commande adaptée.

Native · 98/100Policy : autoriser
Surface agent
Tout agent MCP/CLI
Type
Skill
Installation
Single
Confiance
Confiance : Established
Point d'entrée
FTXUI
Commande d'installation directe
npx -y tokrepo@latest install b1ff29d4-8457-11f1-9bc6-00163e2b0d79 --target codex

À exécuter après confirmation du plan en dry-run.

Introduction

FTXUI is a header-friendly C++ library for creating rich terminal user interfaces. It uses a functional, declarative approach inspired by modern UI frameworks, making TUI development in C++ feel as natural as building web layouts.

What FTXUI Does

  • Provides a declarative DOM-like API for composing terminal UI elements
  • Supports interactive components like buttons, inputs, menus, and toggles
  • Implements flexbox-style layout with hbox, vbox, and flex for responsive design
  • Renders smooth animations and transitions in the terminal
  • Compiles to WebAssembly for running TUI apps in the browser

Architecture Overview

FTXUI is organized into three modules: dom (layout and rendering), component (interactive widgets), and screen (terminal output). The dom layer builds a virtual element tree that is diffed and rendered efficiently. Components handle input events through a simple event loop. The library uses only the C++ standard library with no external dependencies.

Self-Hosting & Configuration

  • Add as a CMake dependency via FetchContent or install system-wide
  • Header-only option available for simpler integration
  • Works on Linux, macOS, Windows (MSVC, GCC, Clang)
  • WebAssembly builds supported via Emscripten for browser deployment
  • No runtime configuration files needed; everything is set in code

Key Features

  • Zero external dependencies beyond the C++ standard library
  • Functional composition model for building complex layouts from simple elements
  • Built-in color support including true color (24-bit) terminals
  • Canvas element for drawing graphics, charts, and plots in the terminal
  • Thread-safe screen updates for concurrent applications

Comparison with Similar Tools

  • ncurses — C API with manual memory management; FTXUI is modern C++ with RAII and composition
  • Textual (Python) — Python-based TUI framework; FTXUI targets native C++ performance
  • Ratatui (Rust) — Rust TUI library; FTXUI fills the same niche for C++ developers
  • Dear ImGui — immediate mode GUI for graphics; FTXUI is terminal-only and declarative
  • Terminal.Gui (.NET) — .NET TUI framework; FTXUI serves the C++ ecosystem

FAQ

Q: Does FTXUI support mouse input? A: Yes. It handles mouse clicks, scroll events, and hover detection on supported terminals.

Q: Can I run FTXUI apps in the browser? A: Yes. FTXUI compiles to WebAssembly via Emscripten, with a DOM-based rendering backend.

Q: Is it header-only? A: It can be used as a compiled library or fetched via CMake FetchContent. It is not strictly header-only but integrates easily.

Q: What terminals are supported? A: Any terminal supporting ANSI escape codes, including xterm, iTerm2, Windows Terminal, and Alacritty.

Sources

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires