Esta página se muestra en inglés. Una traducción al español está en curso.
ConfigsJul 20, 2026·3 min de lectura

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.

Listo para agents

Instalación lista para agent

Este activo puede instalarse después de elegir el runtime, revisar el plan y ejecutar el comando correspondiente.

Native · 98/100Política: permitir
Superficie agent
Cualquier agent MCP/CLI
Tipo
Skill
Instalación
Single
Confianza
Confianza: Established
Entrada
FTXUI
Comando de instalación directa
npx -y tokrepo@latest install b1ff29d4-8457-11f1-9bc6-00163e2b0d79 --target codex

Ejecutar después de confirmar el plan con 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

Discusión

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.

Activos relacionados