What Is tuie?
tuie is a Rust terminal UI library built by Jake Stewart, and it is one of the best Rust TUI Libraries tools for Rust developers building terminal apps and hybrid GUI/TUI interfaces. The repo documents 8 major feature areas plus three feature flags, which tells you immediately that this is not a thin wrapper around a text renderer. It targets developers who need layout, input, rendering, and async behavior in one widget system, not a pile of disconnected crates.
Quick Overview
| Attribute | Details |
|---|---|
| Type | Rust TUI Libraries |
| Best For | Rust developers, indie hackers, and platform teams shipping terminal UIs or hybrid GUI/TUI apps |
| Language/Stack | Rust, with optional winit, wgpu, image, fontdb, freetype-rs, and async runtime integration |
| License | N/A |
| GitHub Stars | N/A as of Feb 2026 |
| Pricing | Open-Source |
| Last Release | N/A |
tuie is interesting because it treats the terminal like a real UI runtime instead of a string printer. The page highlights flexbox-style layout, virtualized lists, dirty tracking, image protocols, and a GUI mode through winit and wgpu, which puts it in the same conversation as modern terminal frameworks rather than old-school ncurses wrappers.
Who Should Use tuie?
- Rust engineers building interactive CLIs who need consistent layout, keyboard handling, and incremental redraws without hand-rolling rendering logic.
- Indie hackers shipping terminal products that need images, palettes, and input modes without forcing users into a browser.
- Platform teams and internal tooling teams that want a shared widget tree for dashboards, control panels, and ops utilities.
- Developers building hybrid terminal/GUI apps who want the same widgets to run in a text terminal or a graphical window.
Not ideal for:
- Teams that only need a one-screen prompt or a static text interface.
- Projects that require a massive ecosystem of prebuilt widgets more than low-level control.
- Non-Rust teams that do not want to adopt Rust’s compile-time ownership model.
Key Features of tuie
- Constraint-based layout — tuie supports flexbox, grids, splits, and virtualized lists with min, max, and preferred-size constraints. That matters when you need terminal panes to behave predictably across narrow SSH sessions and wide desktop terminals.
- Image rendering with fallbacks — the library supports Kitty graphics, sixel, and half-block fallbacks, and the page says it works over SSH and tmux passthrough. That gives you a real path for richer visual interfaces instead of pretending the terminal is text-only.
- Iterator-based text input — input handling is extensible and supports vi, emacs, modern, and custom bindings. This is useful when your app needs command palettes, filter bars, or modal editing without hardcoding one keyboard model.
- Human-readable chords — the
chord!(Ctrl + Arrow(Up | Down))syntax turns key handling into a typed matchable abstraction. That is cleaner than scattering stringly event logic through view code. - Async callbacks and timers — tuie can run timers and async callbacks with any async runtime. That makes it practical for file watchers, network polling, long-running jobs, and agent-style UIs that need background work.
- Dirty tracking and batched queries — the runtime tracks dirtiness per subtree, widget, and cell, then batches queries to reduce redraw work. This is the kind of detail that keeps large trees usable when the screen contains many independently updating regions.
- Generated palette and GUI fallback — the
harmoniousfeature generates a 256-color palette from the terminal base16 theme, andguican switch the same app into a graphical mode usingwinit,wgpu,pollster,fontdb, andfreetype-rs. That is a strong fit when you want one codebase to survive both terminal and desktop use.
tuie vs Alternatives
| Tool | Best For | Key Differentiator | Pricing |
|---|---|---|---|
| tuie | Rich Rust TUIs with images, async, and GUI fallback | Combines widget trees, image protocols, and optional graphical rendering in one crate | Open-Source |
| Ratatui | Broad terminal dashboard and TUI ecosystem | Larger mindshare, more examples, and a simpler text-first approach | Open-Source |
| Cursive | Classic Rust TUI apps with form-like interactions | Mature event handling and straightforward text widgets | Open-Source |
| tui-realm | Declarative terminal apps with a more opinionated component model | Good when you want app structure over low-level rendering details | Open-Source |
Pick Ratatui if you want the safest default and the widest community knowledge base. Pick Cursive if your app is mostly forms, menus, and text interaction.
Pick tuie when you need images, async callbacks, per-cell dirty tracking, or a GUI path without rewriting the app. If your workflow is closer to terminal-native developer tooling, related utilities like Ghist and MiniVim show why richer keyboard-driven interfaces matter.
How tuie Works
tuie is built around a widget tree with composable containers such as Pane and leaf widgets such as Text. The page shows two styles of use: a builder chain for simple trees and a stateful widget struct for apps that need stable IDs and mutation over time. That design is a good fit for Rust because ownership and borrowing stay localized to the tree, not sprayed across callback spaghetti.
The interesting technical choice is that rendering is not just a linear text pass. tuie tracks dirty state per widget and cell, which means it can redraw only what changed, batch queries, and keep large UIs responsive. The same runtime also supports async callbacks, so a widget can react to timers or external events without blocking the main loop.
use tuie::prelude::*;
use std::process::ExitCode;
fn main() -> std::io::Result<ExitCode> {
let root = Pane::new()
.border(Border::SINGLE)
.child(Text::new().content("hello world"));
tuie::start_tui(root)
}
That example creates a single-pane widget tree and launches the terminal runtime. In practice, you replace the static text with mutable state, add input handlers, and compose containers for splits or grids. If you enable harmonious, tuie will also derive a palette from the terminal’s base16 colors, which keeps visual contrast consistent without extra config.
Pros and Cons of tuie
Pros:
- Rich widget model with panes, text, grids, splits, and virtualization for larger screens.
- Image support across Kitty, sixel, SSH, and tmux passthrough, which is rare in Rust terminal libs.
- Low redraw overhead from per-widget and per-cell dirty tracking.
- Flexible input system with built-in vi and emacs bindings plus custom mapping support.
- Single codebase path from terminal UI to GUI mode when you enable
gui. - Async-friendly architecture that does not force blocking loops or ad hoc polling hacks.
Cons:
- Smaller ecosystem than Ratatui, so you may write more custom widgets yourself.
- Rust-only by design, which raises the bar for teams without Rust experience.
- Advanced feature surface can slow down first-time adoption compared with minimal TUI crates.
- GUI mode adds dependencies such as
winitandwgpu, which increase build complexity. - License and release metadata are not surfaced in the scraped page, so you need to confirm repo details before standardizing on it.
Getting Started with tuie
The fastest path is to add the crate with the palette feature, then run a minimal app from main.rs. The repo shows a direct cargo add flow, which is the right level of ceremony for a Rust library.
cargo add tuie --features=harmonious
cargo run
After that, replace the demo tree with your own widget hierarchy and wire state changes through widget IDs or delegate widgets. If you need images later, enable images; if you want desktop rendering, enable gui, which pulls in the graphical stack and implies harmonious.
A realistic first app usually starts with a root Pane, one or two nested containers, and a text or input widget. From there, you can add chords, async callbacks, and custom widgets without changing the runtime model.
Verdict
tuie is the strongest option for Rust teams building rich terminal interfaces when they need images, async behavior, and a path to GUI output in one crate. Its biggest strength is the unified widget/runtime model; the main caveat is that the ecosystem is still smaller than Ratatui’s. Choose tuie when you want control and capability over library maturity.



