Functional Terminal (X) User interface - A simple C++ library for terminal based user interfaces!
FTXUI
Functional Terminal (X) User interface
A simple C++ library for terminal based user interfaces!
Feature
- Functional style. Inspired by [1] and React
- Simple and elegant syntax (in my opinion)
- Keyboard & mouse navigation.
- Support for UTF8 and fullwidth chars (→ 测试)
- Support for animations. Demo 1, Demo 2
- Support for drawing. Demo
- No dependencies
- Cross platform: Linux/MacOS (main target), WebAssembly, Windows (Thanks to contributors!).
- Learn by examples, and tutorials
- Multiple packages: CMake FetchContent (preferred), vcpkg, pkgbuild, conan.
- Good practises: documentation, tests, fuzzers, performance tests, automated CI, automated packaging, etc...
Documentation
Operating systems
This is expected to be cross platform. This supports / tests:
- WebAssembly
- Linux
- MacOS
- Windows
Example
vbox({
hbox({
text("left") | border,
text("middle") | border | flex,
text("right") | border,
}),
gauge(0.5) | border,
});
┌────┐┌───────────────────────────────────────────────────────────────┐┌─────┐
│left││middle ││right│
└────┘└───────────────────────────────────────────────────────────────┘└─────┘
┌────────────────────────────────────────────────────────────────────────────┐
│██████████████████████████████████████ │
└────────────────────────────────────────────────────────────────────────────┘
Short gallery
DOM
This module defines a hierarchical set of Element. An element manages layout and can be responsive to the terminal dimensions.
They are declared in <ftxui/dom/elements.hpp>
Element can be arranged together:
- horizontally with
hbox - vertically with
vbox - inside a grid with
gridbox - wrap along one direction using the
flexbox.
Element can become flexible using the the flex decorator.
Example using hbox, vbox and filler.

Example using gridbox:

Example using flexbox:

An element can be decorated using the functions:
bolddiminvertedunderlinedunderlinedDoubleblinkstrikethroughcolorbgcolor

FTXUI supports the pipe operator. It means: decorator1(decorator2(element)) and element | decorator1 | decorator2 can be used.
FTXUI support every color palette:
Color gallery:

Use decorator border and element separator() to subdivide your UI:
auto document = vbox({
text("top"),
separator(),
text("bottom"),
}) | border;
Demo:

A simple piece of text is represented using text("content").
To support text wrapping following spaces the following functions are provided:
Element paragraph(std::string text);
Element paragraphAlignLeft(std::string text);
Element paragraphAlignRight(std::string text);
Element paragraphAlignCenter(std::string text);
Element paragraphAlignJustify(std::string text);

A class to easily style a table of data.

Drawing can be made on a Canvas, using braille, block, or simple characters:
Simple example:

Complex examples:

Component
The ftxui/component is needed when you want to produce dynamic UI, reactive to the user's input. It defines a set of ftxui::Component. A component reacts to Events (keyboard, mouse, resize, ...) and Render Element (see previous section).
Prebuilt components are declared in <ftxui/component/component.hpp>
Gallery of multiple components. (demo)











Project using FTXUI
Feel free to add your projects here:
- json-tui
- git-tui
- rgb-tui
- chrome-log-beautifier
- x86-64 CPU Architecture Simulation
- ltuiny
- i3-termdialogs
- Just-Fast
- simpPRU
- Pigeon ROS TUI
- hastur
- CryptoCalculator
- todoman
- TimeAccumulator
- vantage
- tabdeeli
- tiles
- cachyos-cli-installer
- beagle-config
- turing_cmd
- StartUp
- eCAL monitor
cpp-best-practices/game_jam
Several games using the FTXUI have been made during the Game Jam:
- TermBreaker [Play web version]
- Minesweeper Marathon [Play web version]
- Grand Rounds
- LightsRound
- DanteO
- Sumo
- Drag Me aROUND
- DisarmSelfDestruct
- TheWorld
- smoothlife
- Consu
External package
It is highly recommended to use CMake FetchContent to depend on FTXUI. This way you can specify which commit you would like to depend on.
include(FetchContent)
FetchContent_Declare(ftxui
GIT_REPOSITORY https://github.com/ArthurSonzogni/ftxui
GIT_TAG v3.0.0
)
FetchContent_GetProperties(ftxui)
if(NOT ftxui_POPULATED)
FetchContent_Populate(ftxui)
add_subdirectory(${ftxui_SOURCE_DIR} ${ftxui_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()
If you don't, the following packages have been created:
Contributors
| version | 4.1.1 |
|---|---|
| license | MIT |
| repository | https://pkg.cppget.org/1/testing |
| download | libftxui-4.1.1.tar.gz |
| sha256 | 9600b998753eda454aff913b6faad8793bdbe88dadea614c6156b2f2cdef3a93 |
| project | FTXUI |
|---|---|
| url | arthursonzogni.github.io/FTXUI/ |
| doc-url | arthursonzogni.github.io/FTXUI/ |
| src-url | github.com/ArthurSonzogni/FTXUI |
| package-url | github.com/build2-packaging/FTXUI |
| package-email | packaging@build2.orgMailing list |
| topics | C++ |
Tests
| libftxui-tests == 4.1.1 |
Examples
| libftxui-examples == 4.1.1 |
Reviews
| fail | 0 |
|---|---|
| pass | 1 |
Builds
| toolchain | public-0.17.0 |
|---|---|
| target | aarch64-linux-gnu |
| tgt config | linux_debian_12-gcc_14-static_O3 |
| timestamp | 2025-11-16 14:07:57 UTC (21:07:00 hours ago) |
| result | warning (test) | warning (test-installed) | log | rebuild |
| toolchain | public-0.17.0 |
|---|---|
| target | aarch64-linux-gnu |
| tgt config | linux_debian_12-gcc_14-ndebug_O3 |
| timestamp | 2025-11-16 14:07:23 UTC (21:07:33 hours ago) |
| result | warning (test) | warning (test-installed) | log | rebuild |
| toolchain | public-0.17.0 |
|---|---|
| target | aarch64-linux-gnu |
| tgt config | linux_debian_12-gcc_14-O3 |
| timestamp | 2025-11-16 14:06:49 UTC (21:08:07 hours ago) |
| result | warning (test) | warning (test-installed) | log | rebuild |
| toolchain | public-0.17.0 |
|---|---|
| target | aarch64-linux-gnu |
| tgt config | linux_debian_12-gcc_14 |
| timestamp | 2025-11-16 14:06:15 UTC (21:08:42 hours ago) |
| result | warning (test) | warning (test-installed) | log | rebuild |
| toolchain | public-0.17.0 |
|---|---|
| target | x86_64-w64-mingw32 |
| tgt config | windows_10-gcc_13.2_mingw_w64-static_O2 |
| timestamp | 2025-11-16 13:10:18 UTC (22:04:38 hours ago) |
| result | warning (test) | warning (test-installed) | log | rebuild |
| toolchain | public-0.17.0 |
|---|---|
| target | x86_64-linux-gnu |
| tgt config | linux_debian_12-gcc_14-static_O3 |
| timestamp | 2025-11-16 13:10:16 UTC (22:04:40 hours ago) |
| result | warning (test) | warning (test-installed) | log | rebuild |
| toolchain | public-0.17.0 |
|---|---|
| target | x86_64-microsoft-win32-msvc14.3 |
| tgt config | windows_10-msvc_17.8-static_O2 |
| timestamp | 2025-11-16 13:09:59 UTC (22:04:57 hours ago) |
| result | warning (update) | warning (test) | warning (test-installed) | log | rebuild |
| toolchain | public-0.17.0 |
|---|---|
| target | x86_64-microsoft-win32-msvc14.3 |
| tgt config | windows_10-msvc_17.8-O2 |
| timestamp | 2025-11-16 13:09:34 UTC (22:05:23 hours ago) |
| result | warning (update) | warning (test) | warning (test-installed) | log | rebuild |
| toolchain | public-0.17.0 |
|---|---|
| target | x86_64-microsoft-win32-msvc14.3 |
| tgt config | windows_10-msvc_17.10-O2 |
| timestamp | 2025-11-16 13:09:14 UTC (22:05:42 hours ago) |
| result | warning (update) | warning (test) | warning (test-installed) | log | rebuild |
| toolchain | public-0.17.0 |
|---|---|
| target | x86_64-linux-gnu |
| tgt config | linux_debian_12-gcc_14-ndebug_O3 |
| timestamp | 2025-11-16 13:09:10 UTC (22:05:46 hours ago) |
| result | warning (test) | warning (test-installed) | log | rebuild |
| toolchain | public-0.17.0 |
|---|---|
| target | x86_64-microsoft-win32-msvc14.3 |
| tgt config | windows_10-msvc_17.8 |
| timestamp | 2025-11-16 13:09:09 UTC (22:05:47 hours ago) |
| result | warning (update) | warning (test) | warning (test-installed) | log | rebuild |
| toolchain | public-0.17.0 |
|---|---|
| target | x86_64-microsoft-win32-msvc14.3 |
| tgt config | windows_10-clang_18_llvm_msvc_17.10-O2 |
| timestamp | 2025-11-16 13:09:05 UTC (22:05:51 hours ago) |
| result | warning (update) | warning (test) | warning (test-installed) | log | rebuild |
| toolchain | public-0.17.0 |
|---|---|
| target | x86_64-microsoft-win32-msvc14.3 |
| tgt config | windows_10-clang_18_llvm_msvc_17.10-static_O2 |
| timestamp | 2025-11-16 13:09:01 UTC (22:05:55 hours ago) |
| result | warning (update) | warning (test) | warning (test-installed) | log | rebuild |
| toolchain | public-0.17.0 |
|---|---|
| target | x86_64-microsoft-win32-msvc14.3 |
| tgt config | windows_10-msvc_17.10-static_O2 |
| timestamp | 2025-11-16 13:08:56 UTC (22:06:00 hours ago) |
| result | warning (update) | warning (test) | warning (test-installed) | log | rebuild |
| toolchain | public-0.17.0 |
|---|---|
| target | x86_64-microsoft-win32-msvc14.3 |
| tgt config | windows_10-clang_17_msvc_msvc_17.10 |
| timestamp | 2025-11-16 13:08:44 UTC (22:06:12 hours ago) |
| result | warning (update) | warning (test) | warning (test-installed) | log | rebuild |
| toolchain | public-0.17.0 |
|---|---|
| target | x86_64-microsoft-win32-msvc14.3 |
| tgt config | windows_10-clang_18_llvm_msvc_17.10 |
| timestamp | 2025-11-16 13:08:39 UTC (22:06:17 hours ago) |
| result | warning (update) | warning (test) | warning (test-installed) | log | rebuild |
| toolchain | public-0.17.0 |
|---|---|
| target | x86_64-linux-gnu |
| tgt config | linux_debian_12-gcc_14-O3 |
| timestamp | 2025-11-16 13:08:38 UTC (22:06:19 hours ago) |
| result | warning (test) | warning (test-installed) | log | rebuild |
| toolchain | public-0.17.0 |
|---|---|
| target | x86_64-linux-gnu |
| tgt config | linux_debian_12-gcc_12-bindist |
| timestamp | 2025-11-16 13:08:33 UTC (22:06:23 hours ago) |
| result | warning (test) | warning (test-installed) | log | rebuild |
| toolchain | public-0.17.0 |
|---|---|
| target | x86_64-microsoft-win32-msvc14.3 |
| tgt config | windows_10-msvc_17.10 |
| timestamp | 2025-11-16 13:08:25 UTC (22:06:31 hours ago) |
| result | warning (update) | warning (test) | warning (test-installed) | log | rebuild |
| toolchain | public-0.17.0 |
|---|---|
| target | x86_64-linux-gnu |
| tgt config | linux_fedora_40-gcc_14-bindist |
| timestamp | 2025-11-16 13:08:14 UTC (22:06:42 hours ago) |
| result | warning (test) | warning (test-installed) | log | rebuild |
| toolchain | public-0.17.0 |
|---|---|
| target | x86_64-linux-gnu |
| tgt config | linux_debian_12-gcc_14 |
| timestamp | 2025-11-16 13:08:14 UTC (22:06:43 hours ago) |
| result | warning (test) | warning (test-installed) | log | rebuild |
| toolchain | public-0.17.0 |
|---|---|
| target | x86_64-freebsd14.1 |
| tgt config | freebsd_14-clang_18 |
| timestamp | 2025-11-16 13:08:13 UTC (22:06:43 hours ago) |
| result | warning (test) | warning (test-installed) | log | rebuild |
| toolchain | public-0.17.0 |
|---|---|
| target | x86_64-linux-gnu |
| tgt config | linux_debian_12-clang_17_libc++ |
| timestamp | 2025-11-16 13:08:10 UTC (22:06:47 hours ago) |
| result | warning (test) | warning (test-installed) | log | rebuild |
| toolchain | public-0.17.0 |
|---|---|
| target | x86_64-linux-gnu |
| tgt config | linux_debian_12-clang_17 |
| timestamp | 2025-11-16 13:08:04 UTC (22:06:52 hours ago) |
| result | warning (test) | warning (test-installed) | log | rebuild |
| toolchain | public-0.17.0 |
|---|---|
| target | x86_64-linux-gnu |
| tgt config | linux_ubuntu_24.04-gcc_13-bindist |
| timestamp | 2025-11-16 13:07:58 UTC (22:06:58 hours ago) |
| result | warning (test) | warning (test-installed) | log | rebuild |
| toolchain | public-0.17.0 |
|---|---|
| target | x86_64-freebsd14.1 |
| tgt config | freebsd_14-clang_18-O3 |
| timestamp | 2025-11-16 13:07:52 UTC (22:07:04 hours ago) |
| result | warning (test) | warning (test-installed) | log | rebuild |
| toolchain | public-0.17.0 |
|---|---|
| target | x86_64-linux-gnu |
| tgt config | linux_debian_12-gcc_13.1 |
| timestamp | 2025-11-16 13:07:45 UTC (22:07:12 hours ago) |
| result | warning (test) | warning (test-installed) | log | rebuild |
| toolchain | public-0.17.0 |
|---|---|
| target | x86_64-freebsd14.1 |
| tgt config | freebsd_14-clang_18-static_O3 |
| timestamp | 2025-11-16 13:07:44 UTC (22:07:12 hours ago) |
| result | warning (test) | warning (test-installed) | log | rebuild |
| toolchain | public-0.17.0 |
|---|---|
| target | x86_64-freebsd13.3 |
| tgt config | freebsd_13-clang_17 |
| timestamp | 2025-11-16 13:07:36 UTC (22:07:20 hours ago) |
| result | warning (test) | warning (test-installed) | log | rebuild |
| toolchain | public-0.17.0 |
|---|---|
| target | aarch64-linux-gnu |
| tgt config | linux_debian_12-clang_18_libc++-static_O3 |
| timestamp | 2025-11-16 13:05:57 UTC (22:08:59 hours ago) |
| result | warning (test) | warning (test-installed) | log | rebuild |
| toolchain | public-0.17.0 |
|---|---|
| target | aarch64-linux-gnu |
| tgt config | linux_debian_12-clang_18_libc++ |
| timestamp | 2025-11-16 13:04:55 UTC (22:10:01 hours ago) |
| result | warning (test) | warning (test-installed) | log | rebuild |
| toolchain | public-0.17.0 |
|---|---|
| target | aarch64-linux-gnu |
| tgt config | linux_debian_12-clang_18_libc++-O3 |
| timestamp | 2025-11-16 13:04:51 UTC (22:10:05 hours ago) |
| result | warning (test) | warning (test-installed) | log | rebuild |
| toolchain | public-0.17.0 |
|---|---|
| target | aarch64-linux-gnu |
| tgt config | linux_debian_12-clang_18-static_O3 |
| timestamp | 2025-11-16 13:04:22 UTC (22:10:34 hours ago) |
| result | warning (test) | warning (test-installed) | log | rebuild |
| toolchain | public-0.17.0 |
|---|---|
| target | aarch64-linux-gnu |
| tgt config | linux_debian_12-clang_18-O3 |
| timestamp | 2025-11-16 13:04:17 UTC (22:10:40 hours ago) |
| result | warning (test) | warning (test-installed) | log | rebuild |
| toolchain | public-0.17.0 |
|---|---|
| target | aarch64-linux-gnu |
| tgt config | linux_debian_12-clang_18 |
| timestamp | 2025-11-16 13:03:46 UTC (22:11:10 hours ago) |
| result | warning (test) | warning (test-installed) | log | rebuild |
| toolchain | public-0.17.0 |
|---|---|
| target | x86_64-w64-mingw32 |
| tgt config | windows_10-gcc_13.2_mingw_w64-O2 |
| timestamp | 2025-11-16 12:02:44 UTC (23:12:12 hours ago) |
| result | error (test) | log | rebuild |
| toolchain | public-0.17.0 |
|---|---|
| target | x86_64-w64-mingw32 |
| tgt config | windows_10-gcc_13.2_mingw_w64 |
| timestamp | 2025-11-16 12:02:36 UTC (23:12:21 hours ago) |
| result | error (test) | log | rebuild |
| toolchain | public-0.17.0 |
|---|---|
| target | aarch64-linux-gnu |
| tgt config | linux_debian_12-clang_17_libc++ |
| timestamp | 2025-11-16 11:22:45 UTC (23:52:11 hours ago) |
| result | warning (test) | warning (test-installed) | log | rebuild |
| toolchain | public-0.17.0 |
|---|---|
| target | aarch64-linux-gnu |
| tgt config | linux_debian_12-gcc_13 |
| timestamp | 2025-11-16 11:22:27 UTC (23:52:29 hours ago) |
| result | warning (test) | warning (test-installed) | log | rebuild |
| toolchain | public-0.17.0 |
|---|---|
| target | aarch64-linux-gnu |
| tgt config | linux_debian_12-clang_17 |
| timestamp | 2025-11-16 11:22:10 UTC (23:52:47 hours ago) |
| result | warning (test) | warning (test-installed) | log | rebuild |
| toolchain | public-0.17.0 |
|---|---|
| target | x86_64-linux-gnu |
| tgt config | linux_debian_12-clang_18 |
| result | unbuilt |
| toolchain | public-0.17.0 |
|---|---|
| target | x86_64-linux-gnu |
| tgt config | linux_debian_12-clang_18-O3 |
| result | unbuilt |
| toolchain | public-0.17.0 |
|---|---|
| target | x86_64-linux-gnu |
| tgt config | linux_debian_12-clang_18-static_O3 |
| result | unbuilt |
| toolchain | public-0.17.0 |
|---|---|
| target | x86_64-linux-gnu |
| tgt config | linux_debian_12-clang_18_libc++ |
| result | unbuilt |
| toolchain | public-0.17.0 |
|---|---|
| target | x86_64-linux-gnu |
| tgt config | linux_debian_12-clang_18_libc++-O3 |
| result | unbuilt |
| toolchain | public-0.17.0 |
|---|---|
| target | x86_64-linux-gnu |
| tgt config | linux_debian_12-clang_18_libc++-static_O3 |
| result | unbuilt |
| toolchain | public-0.17.0 |
|---|---|
| target | x86_64-linux-gnu |
| tgt config | linux_fedora_39-gcc_13-bindist |
| result | unbuilt |
| toolchain | public-0.17.0 |
|---|---|
| target | x86_64-apple-darwin22.5.0 |
| tgt config | macos_13-clang_15.0 |
| result | unbuilt |
| toolchain | public-0.17.0 |
|---|---|
| target | x86_64-apple-darwin23.5.0 |
| tgt config | macos_14-clang_15.0 |
| result | unbuilt |
| toolchain | public-0.17.0 |
|---|---|
| target | x86_64-apple-darwin23.5.0 |
| tgt config | macos_14-clang_15.0-O3 |
| result | unbuilt |
| toolchain | public-0.17.0 |
|---|---|
| target | x86_64-apple-darwin23.5.0 |
| tgt config | macos_14-clang_15.0-static_O3 |
| result | unbuilt |
| toolchain | public-0.17.0 |
|---|---|
| target | x86_64-apple-darwin23.5.0 |
| tgt config | macos_14-gcc_14_homebrew |
| result | unbuilt |
| toolchain | public-0.17.0 |
|---|---|
| target | x86_64-apple-darwin23.5.0 |
| tgt config | macos_14-gcc_14_homebrew-O3 |
| result | unbuilt |
| toolchain | public-0.17.0 |
|---|---|
| target | x86_64-apple-darwin23.5.0 |
| tgt config | macos_14-gcc_14_homebrew-static_O3 |
| result | unbuilt |