Terminal applications are having a renaissance. Tools like lazygit, btop, and k9s prove that TUIs can be genuinely pleasant to use.
Rust's ownership model makes it surprisingly ergonomic for TUI development. You get fearless concurrency for background tasks, zero-cost abstractions for rendering, and a binary that starts in milliseconds.
Ratatui is the successor to tui-rs and the go-to crate for terminal rendering in Rust. It uses an immediate-mode rendering approach — you describe your UI every frame, and the library diffs it against the previous frame.
Ratatui uses a constraint-based layout system. You define areas using percentages, fixed sizes, or min/max constraints:
let chunks = Layout::default()
.direction(Direction::Vertical)
.constraints([
Constraint::Length(3),
Constraint::Min(0),
Constraint::Length(1),
])
.split(frame.area());The best TUIs feel like they belong in the terminal. Resist the urge to recreate a GUI — lean into keyboard shortcuts, vim-style bindings, and information density.