Ratatui is a Rust framework and cross-platform terminal renderer used to build rich terminal user interfaces. It functions as a toolkit for creating interactive command-line displays, dashboards, and data visualizations.
The library employs an immediate mode rendering approach, where the interface is redrawn every frame based on the current application state. It uses a widget-based layout system to compose complex text-based interfaces.
The framework includes a rectangle-based layout engine and a backend-agnostic drawing system to decouple UI logic from specific terminal emulators. It further utilizes double-buffered output and state diffing to manage how characters are written to the screen.