AppCUI-rs
β― ππ½π½ππ¨π-πΏπ π³
AppCUI-rs is a fast, cross-platform Rust library for building modern, text-based user interfaces (TUIs) with rich widgets, themes, and full Unicode supportβan alternative to ncurses and other terminal UI frameworks.
β¨ Features
- multiple out-of-the-box controls (buttons, labels, text boxes, check boxes, radio buttons, list views, tree views, buffer view, hexview, progress bar, graph view, combo boxes, date/time pickers, color pickers, tabs, accordions, etc.).
- powerful layout system that allows you to position controls using absolute coordinates, relative coordinates, docking, alignment, anchors, or pivot positioning (see more here)
- menus and toolbars
- multi-platform support (Windows via API and virtual terminal, Linux via ncurses, macOS via termios)
- multi-threading support to allow background tasks
- timers
- mouse support
- clipboard support
- color themes
- support for Unicode characters
- predefined dialogs (message box, input box, color picker, save & open dialogs, folder navigator, etc.)
- true-color support (24 bits per pixel) for terminals that support it.
π¦ Out-of-the-box controls and widgets
AppCUI-rs ships with a rich set of controls and widgets for building terminal user interfaces. The full list of stock controls is documented here.
Basic controls
- Button β clickable action trigger
- ToggleButton β button with pressed/unpressed state
- Label β static, non-interactive text
- CheckBox β toggle on/off
- RadioBox β mutually exclusive choice within a group
- ThreeStateBox β tri-state checkbox (checked/unchecked/unknown)
- Toolbar - for window controls (with buttons, checkboxes, radioboxes)
Containers - Group and organize other controls.
- Panel β simple rectangular grouping container
- Tab β switch between multiple pages of content
- Accordion β collapsible/expandable panels
- Window β top-level movable/resizable frame
- Desktop β root container hosting windows
- Modal dialog β blocking dialog window
Separators
- HSplitter / VSplitter β resizable dividers between regions (horizontal & vertical)
- HLine / VLine β static visual separator lines (horizontal & vertical)
Selectors - Choose from a set of values you provide.
- Selector β generic single-value enum selector
- DropDownList β dropdown list of typed items
- ComboBox β editable dropdown selection
- ListBox β scrollable list selection
- NumericSelector β pick a number within a range
- KeySelector β capture a keyboard key/shortcut
- HSlider β value slider
Pickers - Choose from a built-in domain.
- DatePicker β select a date
- TimePicker β select a time
- ColorPicker β select a color
- CharPicker β pick a character/glyph
- PathFinder β browse and select a filesystem path
Data viewers - Display and navigate structured or large data sets.
- ListView β tabular, multi-column data
- TreeView β hierarchical data
- BufferView β raw binary/byte (hex) inspection (also a HexViewer or BinaryDataViewer)
- Markdown β rendered Markdown content
- GraphView β nodes-and-edges graph rendering
- ImageViewer β display images
Text
- TextField β single-line text input
- RichTextField β text with formatting/styling
- Password β masked text input
- TextArea β multi-line text input
Navigation
- Menu β classic dropdown menus (including buttons, checkboxes, radioboxes, separators, sub-menus)
- CommandBar β key-bound command strip
- PopupMenu β contextual popup menu
Drawing
- Canvas β free-form drawing surface
Other
- HyperLink β clickable link
- ToolTip β hover hint text
- ProgressBar β task progress indicator
πΈ Screenshots
π Check out the Gallery for full demos of all controls!
π₯οΈ Backends
AppCUI supports various backends depending on the operating system:
- Windows Console - based on the Win32 low-level API, designed for the classical Windows console
- Windows VT - based on ANSI sequences, designed for modern Windows virtual terminals
- NCurses - based on the NCurses API for Linux environments
- Termios - based on ANSI sequences and low-level APIs for macOS
- Web Terminal - designed for web implementations (based on WebGL)
- CrossTerm - based on the
crosstermcrate, enabled via a feature flag
More on the supported backends can be found here
π Quick Start
Add the following to your Cargo.toml:
[]
= "0.5"
Then create a new Rust project and add the following code:
use *;
Or a more compact version using proc-macros:
use *;
Alternatively, you can use the frame-based or input-based mode to create applications that can access the screen directly (without needing the entire UI architecture):
use *;
;
Then run the project with cargo run. You should see a window with the title Test and the text Hello World ! in the center.
π§ͺ Examples
AppCUI-rs comes with a set of examples to help you get started. You can find them in the examples folder, including:
- Games such as Tic Tac Toe, Snake, Flappy Bird, Minesweeper, Ram it, PacMan, Chess, Connect Four, 2048, Memory, or Tetris
- Utilities such as Calculator, CSV Viewer, Temperature Converter, HexViewer, or a Timer
- Animations such as Matrix, Fractals, Plasma or Spiral
- Controls/Widgets such as Button, CheckBox, ComboBox, DatePicker, ListView, TreeView and many more.
- Dialogs such as Notification or Input
π οΈ A more complex example
An example that creates a window with a button that, when pressed, increases a counter.
use *;
// Create a window that handles button events and has a counter
π£οΈ Roadmap
- Basic set of widgets and support for Windows, Linux, and macOS
- WebGL / WebAssembly support
- Frame-based mode support (ideal for game development)
- Input-based mode support (for applications that require user input)
- OpenGL / SDL / Vulkan support
- Editor support (syntax highlighting, code folding, etc.)
- Rich Text support (rich text editing, formatting, etc.)
- Sixel support for terminal graphics
- Property Grid control
π€ Contributing
Contributions, issues, and feature requests are welcome!
Check out CONTRIBUTING.md to get started.
Join the discussion in GitHub Discussions.