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, combo boxes, date/time pickers, color pickers, tabs, accordions, etc.). A full list of controls can be found here
- 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.
πΈ 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:
[]
= "*"
Then create a new Rust project and add the following code:
use *;
Or a more compact version using proc-macros:
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, or Tetris
- Utilities such as Calculator, CSV Viewer, Temperature Converter, or a Timer
- Animations such as Matrix, Fractals, 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 support
- OpenGL / SDL / Vulkan support
- TextArea support for code highlighting
π€ Contributing
Contributions, issues, and feature requests are welcome!
Check out CONTRIBUTING.md to get started.
Join the discussion in GitHub Discussions.