#ui-framework #cui #menu #button #ui #checkbox #cross-platform #view #text-based #feature-rich

appcui

A feature-rich and cross-platform TUI/CUI framework for Rust, enabling modern terminal-based applications on Windows, Linux, and macOS. Includes built-in UI components like buttons, menus, list views, tree views, checkboxes, and more. Perfect for building fast and interactive CLI tools and text-based interfaces.

10 releases

new 0.1.9 Jul 9, 2025
0.1.8 Jul 5, 2025
0.1.6 Jun 28, 2025

#92 in GUI

Download history 112/week @ 2025-06-04 260/week @ 2025-06-11 152/week @ 2025-06-18 425/week @ 2025-06-25 273/week @ 2025-07-02

1,117 downloads per month

MIT license

3.5MB
81K SLoC

AppCUI-rs

โฏˆ ๐—”๐—ฝ๐—ฝ๐—–๐—จ๐—œ-๐—ฟ๐˜€ ๐Ÿ–ณ

Windows Build Status Linux Build Status MacOS Build Status Code Coverage License Crates.io Docs.rs

AppCUI is a simple, easy-to-use and cross-platform library for creating text-based user interfaces in Rust:

โœจ 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, etc.).
  • menus and toolbars
  • multi-platform support (Windows via API, Linux via ncurses, MacOS via termios)
  • multi-threading support
  • 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 colors support (24 bits per pixel) for terminals that supports it.

๐Ÿ“ธ Screenshots

๐Ÿ–ฅ๏ธ Backends

AppCUI supports various backends based on the operating system it is being used for:

  • Windows Console - based on Win32 low level API, design for clasical windows console
  • Windows VT - based on ANSI sequances, designed for modern windows virtual terminals
  • NCurses - based on NCurses API for linux envinronments
  • Termios - based on ANSI sequances and low level APIs for MAC OSX
  • Web Terminal - designed for Web implementation (based on webgl)
  • CrossTerm - based on the crossterm crate, but enabled via a feature flag

More on the supported backends can be found here

๐Ÿš€ Quick Start

Add the following to your Cargo.toml:

[dependencies]
appcui = "*"

Then create a new Rust project and add the following code:

use appcui::prelude::*;

fn main() -> Result<(), appcui::system::Error> {
    let mut app = App::new().build()?;
    let mut win = window!("Test,d:c,w:30,h:9");
    win.add(label!("'Hello World !',d:c,w:13,h:1"));
    app.add_window(win);
    app.run();
    Ok(())
}

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

Check out the examples folder for more examples.

๐Ÿ› ๏ธ A more complex example

Am example that creates a window with a button that when pressed increases a counter.

use appcui::prelude::*;

// Create a window that handles button events and has a counter
#[Window(events = ButtonEvents)]
struct CounterWindow {
    counter: i32
}

impl CounterWindow {
    fn new() -> Self {
        let mut w = Self {
            // set up the window title and position
            base: window!("'Counter window',d:c,w:30,h:5"),
            // initial counter is 1
            counter: 1            
        };
        // add a single button with the caption "1" (like the counter)
        w.add(button!("'1',d:b,w:20"));
        w
    }
}
impl ButtonEvents for CounterWindow {
    // When the button is pressed, this function will be called
    // with the handle of the button that was pressed
    // Since we only have one button, we don't need to store its handle 
    // in the struct, as we will receive the handle via the on_pressed method
    fn on_pressed(&mut self, handle: Handle<Button>) -> EventProcessStatus {
        // increase the counter
        self.counter += 1;
        // create a text that containe the new counter
        let text = format!("{}",self.counter);
        // aquire a mutable reference to the button using its handle
        if let Some(button) = self.control_mut(handle) {
            // set the caption of the button to th new text
            button.set_caption(&text);
        }
        // Tell the AppCUI framework that we have processed this event
        // This allows AppCUI to repaint the button
        EventProcessStatus::Processed
    }
}

fn main() -> Result<(), appcui::system::Error> {
    // create a new application
    let mut a = App::new().build()?;
    // add a new window (of type CounterWindow) to the application
    a.add_window(CounterWindow::new());
    // Run AppCUI framework (this wil start the window loop and messaage passing)
    a.run();
    Ok(())
}

๐Ÿ›ฃ๏ธ 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.

Dependencies

~1โ€“19MB
~207K SLoC