How arthursonzogni/ftxui works
FTXUI is a cross-platform C++ terminal UI library. An application builds interactive components, runs them through an event/task loop, composes their output as DOM elements, and renders cells to the terminal. The README documents layout, styling, drawing, keyboard/mouse interaction, UTF-8, and animation; unsampled implementation details are represented only where the tree or excerpts support them.
Main entry points: app.cpp App Loop · elements.hpp DOM Elements · screen.cpp Screen Surface · component Interactive Widgets
Components 14
Interaction
- App Loop
src/ftxui/component/app.cpp - Interactive Widgets
src/ftxui/component - Events and Input
src/ftxui/component/terminal_input_parser.cpp - Animation
src/ftxui/component/animation.cpp
UI Composition
- DOM Elements
include/ftxui/dom/elements.hpp - Layout and Text
src/ftxui/dom/paragraph.cpp - Style and Color
src/ftxui/dom/color.cpp - Canvas Drawing
src/ftxui/dom/canvas.cpp
Terminal Rendering
- Screen Surface
src/ftxui/screen/screen.cpp - Cells and Colors
include/ftxui/screen/cell.hpp - UTF-8 Strings
src/ftxui/screen/string.cpp
Runtime Support
- Task Runner
src/ftxui/component/task_runner.cpp
Other components
- Application Developer
- Terminal
Connections 16
- Application Developer → Interactive Widgets: defines UI
- Application Developer → App Loop: starts loop
- App Loop → Interactive Widgets: dispatches events
- App Loop → Events and Input: parses input
- App Loop → Task Runner: runs tasks
- App Loop → DOM Elements: renders elements
- Interactive Widgets → DOM Elements: produces elements
- Animation → App Loop: requests frames
- DOM Elements → Layout and Text: lays out content
- DOM Elements → Style and Color: decorates elements
- DOM Elements → Canvas Drawing: draws canvas
- App Loop → Screen Surface: renders screen
- Screen Surface → Cells and Colors: uses cells
- Screen Surface → UTF-8 Strings: measures strings
- Screen Surface → Terminal: prints output
- Terminal → App Loop: provides input