A modular, high-performance Terminal User Interface (TUI) and Windowing System for Dart.
This library shifts away from naive command-line printing (which causes terminal flickering and excessive CPU overhead) to provide a desktop-like windowed environment inside standard ANSI/TTY terminal applications.
termui2.mp4
Warning
Experimental Status: This project is experimental and currently under active development. The APIs are subject to change, and features are being added and refactored frequently. If you want to use it, reach out and give feedback!
- Overlapping Window Management: Supports floating, draggable, and resizable window frames with titles, custom borders, and dynamic Z-index layering.
- Double Buffering & Minimal ANSI Diffing: Eliminates terminal flickering by maintaining an in-memory frame buffer and emitting the shortest possible cursor jumps and style transitions for modified cells.
- Layout Solver: Flexible box constraints layout system featuring fixed size, flex (
Expanded/Flexible), alignment, split panes, and viewport boundaries. - Hierarchical Input & Focus System: Translates raw ANSI byte streams from
stdininto high-level event objects (keys, mouse clicks/scrolls/drags, paste segments) and dispatches them down a keyboard focus node tree. - Vector Graphics, Braille Canvas & Image Quantization: Features a 2D sub-pixel braille canvas (
Canvas) and a Chafa-inspired Unicode/DIN99d image-to-ANSI quantizer (termui_tinpot). - Modular Widget Toolkit: Standard widgets including paragraphs, lists, text inputs, text areas with cursors, progress bars, tables, paginators, spinners, sparklines, and trees.
- Embedded PTY & Virtual Terminal Emulator: Spawn native OS shells via
pty2(Unixopenptyand WindowsConPTY) and embed interactive terminal views inside TUI windows viatermui_pty. - Flutter & Web GPU Renderer: Render
termuiapplications inside Flutter desktop, mobile, and web apps using a batcheddrawRawAtlasglyph texture atlas (termui_flutter). - 3D Spatial Audio & Synthesis: Play spatial audio, synthesized waveforms, and filtered audio buses in CLI and Flutter apps (
termui_audio,termui_audio_flutter). - Recording, Golden Testing & Performance Tracing: Capture Asciicast v3 sessions, run headless deterministic tests (
termui_recorder,termui_test), hot-reload TUI code (termui_hotreload), and inspect flame charts (termui_trace). - Terminal Multiplexer & Remote PTY Casting: Run
fterm(apps/fterm) as a native desktop multiplexer or WebAssembly browser client, and stream live PTY sessions over WebSockets with apps/termui_cast.
mcdole_heavy_industries_tui_trim.mp4
graph TD
example_flutter["example_flutter"]
style example_flutter stroke:#786cb7
pty2["pty2"]
style pty2 stroke:#a8abfc
termui["termui"]
style termui stroke:#3c0db3
termui_audio["termui_audio"]
style termui_audio stroke:#4144b1
termui_audio_flutter["termui_audio_flutter"]
style termui_audio_flutter stroke:#5c6bc0
termui_audio_example["termui_audio_example"]
style termui_audio_example stroke:#470d74
termui_flutter["termui_flutter"]
style termui_flutter stroke:#3ce6cb
termui_hotreload["termui_hotreload"]
style termui_hotreload stroke:#d2beaf
termui_hotreload_example["termui_hotreload_example"]
style termui_hotreload_example stroke:#e6b72b
termui_pty["termui_pty"]
style termui_pty stroke:#902693
termui_recorder["termui_recorder"]
style termui_recorder stroke:#2353a3
termui_shared_examples["termui_shared_examples"]
style termui_shared_examples stroke:#1da6db
termui_test["termui_test"]
style termui_test stroke:#ee49b8
termui_tinpot["termui_tinpot"]
style termui_tinpot stroke:#7e7070
termui_tinpot_example["termui_tinpot_example"]
style termui_tinpot_example stroke:#c46eab
example_flutter --> termui
example_flutter --> termui_flutter
example_flutter --> termui_shared_examples
example_flutter --> termui_recorder
example_flutter --> termui_pty
example_flutter --> pty2
example_flutter -.-> termui_test
termui -.-> termui_shared_examples
termui -.-> termui_recorder
termui -.-> termui_test
termui_audio --> termui
termui_audio_flutter --> termui_audio
termui_audio_example --> termui
termui_audio_example --> termui_flutter
termui_audio_example --> termui_audio
termui_audio_example --> termui_audio_flutter
termui_flutter --> termui
termui_flutter -.-> termui_shared_examples
termui_flutter -.-> termui_test
termui_hotreload --> termui
termui_hotreload_example --> termui
termui_hotreload_example --> termui_hotreload
termui_pty --> termui
termui_pty --> pty2
termui_pty -.-> termui_shared_examples
termui_pty -.-> termui_test
termui_recorder --> termui
termui_shared_examples --> termui
termui_shared_examples --> termui_recorder
termui_shared_examples --> termui_pty
termui_shared_examples --> pty2
termui_test --> termui
termui_test --> termui_recorder
termui_tinpot --> termui
termui_tinpot -.-> termui_recorder
termui_tinpot_example --> termui
termui_tinpot_example --> termui_flutter
termui_tinpot_example --> termui_tinpot
termui_tinpot_example --> termui_recorder
termui_tinpot_example -.-> termui_test
subgraph packages0 ["packages"]
pty2
termui
termui_audio
termui_audio_flutter
termui_flutter
termui_hotreload
termui_pty
termui_recorder
termui_shared_examples
termui_test
termui_tinpot
end