ratada
A reusable ratatui widget toolkit for Rust terminal apps.
ratada provides the generic building blocks for a TUI over ratatui and
crossterm: a terminal guard and event loop, modals, forms, text editing,
pickers, tables, trees, a fuzzy finder, a help overlay, a command palette,
footers and status bars, plus a framework-agnostic theming layer (colors,
palette and glyphs) that maps onto ratatui styles.

Overview
- Driver – a
TuiRAII terminal guard (raw mode + alternate screen) and a genericrunloop over aScreentrait. - Widgets – modals (
confirm,confirm_default,input,input_wide,select,multi_select,number_input,message), forms, single- and multi-line text editing with a shared editor core, autocomplete, tables, trees, selectable lists, sectioned sidebars, tabs, pagers, gauges, spinners, toasts (timed, stacked, each box as tall as its wrapped message). - Pickers – color, swatch, date, date-range, month, path (with an optional confinement root) and slider pickers.
- Overlays & chrome – a fuzzy help overlay, a command palette, box framing, header and status bars, and wrapping shortcut-hint footers.
- Markdown – a CommonMark renderer (headings, lists, task lists, code
blocks, quotes, GFM tables/callouts, links) producing styled lines, plus a
scrollable
MarkdownViewwidget and a viewer modal. - Theming – a
Skinbundling aPalette(semantic colors) andGlyphs(Unicode/ASCII variants); framework-agnostic so a CLI can share it, with a single ratatui adapter instyle. A theme names a few base colors and the rest is derived:border_focusfollowsborderunless it is set, and an override onborderalone drags it along, so a focused frame never sinks into its own border. - Diagnostics – degraded conditions (a missing clipboard tool, an unreadable
directory, an invalid color override, a failed terminal restore) are emitted
through the
logfacade atwarn/error; install a logger to surface them.
Usage
[]
= "0.3"
Requires Rust 1.88 or newer (the crate uses let-chains).
Implement the Screen trait and hand it to run, which owns the draw/input
loop inside a raw-mode Tui guard. The prelude re-exports the driver
essentials:
use *;
use ;
use ;
Widgets that support the opt-in boxed style take a BoxDecor (caption in the
top border, an automatic or fixed badge bottom-right), e.g.
InputField::new("").max_len(40).boxed(BoxDecor::new().caption("Name")).
Documentation
- API reference on docs.rs – the authoritative,
complete rustdoc (or
cargo doc --openlocally). CHANGELOG.md– release history (Keep a Changelog + SemVer).DEVELOPMENT.md– module layout, conventions and how to add a widget.CLAUDE.md– the binding style guide.
License
Licensed under the MIT License. See
LICENSE.