v0.30.2 Latest stable release · June 2026

Ratatui – A Powerful Rust Library for Modern Terminal Interfaces

Ratatui simplifies terminal application development with customizable widgets, flexible layouts, and high-performance rendering, enabling developers to create sophisticated, interactive, and responsive terminal user interfaces in Rust.

cargo add ratatui
  • Open source · MIT
  • Windows, Linux & macOS
  • Rust 1.88.0+
Ratatui system monitor dashboard with CPU chart, process table, memory gauge and disk bar chart Ratatui operations dashboard with a service status table, rollout gauge and event log Ratatui data visualization screen with KPI blocks, revenue line chart and grouped bar chart
$ cargo run --release # system monitor● rendered with ratatui 0.30.2

Illustrative previews rendered with Ratatui's own widgets. Use the tabs or arrow keys to switch views.

02 · overview

What Is Ratatui?

Ratatui is an open-source Rust library for building terminal user interfaces. It provides layouts, styled text and widgets for applications that run in a terminal.

Your application manages its state and input, while Ratatui draws each frame and updates the cells that changed. This approach works well for dashboards, developer tools and interactive applications used locally or over SSH.

Ratatui is the community-maintained continuation of tui-rs. Explore the documentation and examples to get started.

03 · features

Powerful Features of Ratatui

Everything you need to design a terminal interface, from the grid of cells up to complete dashboards.

High-Performance Terminal Rendering

Ratatui keeps two buffers and diffs them after every draw, so only changed cells are written to the terminal. Rendering stays fast even when you redraw the whole layout on each tick.

Rich and Customizable Widget Library

Block, Paragraph, List, Table, Tabs, Gauge, LineGauge, Sparkline, Chart, BarChart, Canvas, Scrollbar and Calendar are built in, each configurable through a builder API.

Gallery of built-in Ratatui widgets including paragraph, list, table, chart, bar chart, gauge, tabs, scrollbar and canvas

Flexible and Responsive Layout System

Split areas with Length, Percentage, Ratio, Min, Max and Fill constraints that adapt as the terminal resizes.

Advanced Text Styling and Color Support

Compose Span, Line and Text with ANSI, 256-color or 24-bit RGB colors and modifiers like bold, italic and underline.

Cross-Platform Terminal Compatibility

The default crossterm backend runs on Windows, Linux and macOS terminals from a single codebase.

Interactive Application Development

Stateful widgets such as List and Table track selection and scrolling while your code reacts to keys and mouse events.

04 · how it works

How Does Ratatui Work?

Your application handles input and maintains state. On each draw, Ratatui lays out widgets, renders them into a buffer and sends changed cells to the terminal through a backend such as crossterm.

Use ratatui::run() to initialize and restore the terminal, and update your state in response to keyboard or mouse events.

05 · installation

How to Install and Configure Ratatui

These steps were tested with Rust 1.97 and Ratatui 0.30.2. Any Rust toolchain from 1.88.0 onward works.

Step 1

Installing Rust and Cargo

Install the toolchain with rustup, which also installs Cargo. On Windows, download rustup-init.exe from rust-lang.org and accept the Visual Studio build tools prompt.

Linux / macOS
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustc --version   # should print 1.88.0 or newer
Step 2

Creating a New Rust Project

Cargo scaffolds a binary crate with src/main.rs and a Cargo.toml manifest.

Terminal
cargo new ratatui-app
cd ratatui-app
Step 3

Adding Ratatui as a Cargo Dependency

cargo add writes the latest compatible version into Cargo.toml with default features enabled.

Terminal
cargo add ratatui
Cargo.toml
[dependencies]
ratatui = "0.30.2"
Step 4

Configuring the Crossterm Backend

crossterm is a default feature and is re-exported as ratatui::crossterm, so you do not need a separate dependency. Import events from the re-export to avoid version mismatches.

Rust
use ratatui::crossterm::event::{self, Event, KeyCode};

To use another backend, disable defaults and pick one feature, for example cargo add ratatui --no-default-features --features termion,all-widgets.

Step 5

Installing Ratatui from GitHub

To test unreleased changes, point Cargo at the repository. Pin a commit with rev for reproducible builds.

Terminal
cargo add ratatui --git https://github.com/ratatui/ratatui
Cargo.toml
[dependencies]
ratatui = { git = "https://github.com/ratatui/ratatui" }
Step 4

Building Your First Ratatui Application

Replace src/main.rs with this complete Hello World program. It compiles without warnings on Ratatui 0.30.2.

src/main.rs
use ratatui::crossterm::event::{self, Event, KeyCode, KeyEventKind};
use ratatui::widgets::{Block, Paragraph};
use ratatui::{DefaultTerminal, Frame};

fn main() -> std::io::Result<()> {
    // ratatui::run() enables raw mode and the alternate screen,
    // runs your closure, then restores the terminal (even on panic).
    ratatui::run(app)
}

fn app(terminal: &mut DefaultTerminal) -> std::io::Result<()> {
    loop {
        terminal.draw(render)?;
        if let Event::Key(key) = event::read()? {
            if key.kind == KeyEventKind::Press && key.code == KeyCode::Char('q') {
                return Ok(());
            }
        }
    }
}

fn render(frame: &mut Frame) {
    let block = Block::bordered().title(" Hello Ratatui ");
    let greeting = Paragraph::new("Hello, World! Press q to quit.")
        .centered()
        .block(block);
    frame.render_widget(greeting, frame.area());
}
Expected output (44 × 5 terminal)
┌ Hello Ratatui ───────────────────────────┐
│      Hello, World! Press q to quit.      │
│                                          │
│                                          │
└──────────────────────────────────────────┘

Common installation notes: on Linux, a missing linker error means you need your distribution's build tools (for example build-essential). On Windows, install the "Desktop development with C++" workload. If the screen stays garbled after a crash, run reset (Unix) or close the terminal tab.

Terminal session running cargo new, cargo add ratatui and cargo run
The full install flow: create the project, add the crate, compile and run.
Step 5

Running and Testing Your Application

Run from a real terminal, not an IDE output pane, because raw mode needs a TTY. Press q to quit.

Terminal
cargo run
cargo run --release   # optimized build for profiling

Write rendering tests with TestBackend, which captures the buffer in memory so you can assert on the exact characters drawn.

06 · use cases

Practical Applications of Ratatui

The screens below are original illustrative previews built with Ratatui widgets. They show the kinds of tools teams build, not specific published products.

Illustrative Ratatui system monitor with per-core CPU gauges, process table and memory gauge
Illustrative preview

Real-Time System Monitoring Dashboards

Per-core CPU gauges, process tables and memory meters that refresh every second using a tick-based loop.

Illustrative Ratatui DevOps dashboard listing services, pod counts, latency and deployment events
Illustrative preview

DevOps and Server Administration Tools

Deployment status, rollout progress and event logs in one keyboard-driven screen that works over SSH.

Illustrative Ratatui three-pane file manager with directory list, file table and code preview
Illustrative preview

Terminal-Based File Managers

Miller-column navigation with previews, built from lists, tables and paragraphs side by side.

Illustrative Ratatui network monitor with throughput chart, connection table and latency sparkline
Illustrative preview

Network Monitoring Applications

Throughput charts, live connection tables and latency sparklines per interface.

Illustrative Ratatui analytics screen with KPI cards, revenue line chart, grouped bars and region table
Illustrative preview

Financial and Statistical Data Visualization

KPI tiles, trend lines and grouped bars for reports that run in the terminal or in CI logs.

Plus many more

Interactive Command-Line Applications

Wizards, pickers and fuzzy finders that upgrade a plain CLI with menus, forms and live feedback while staying scriptable.

Database Management Interfaces

Browse schemas, run queries and page through result tables without leaving the terminal.

Git and Version Control Tools

Stage hunks, browse logs and resolve conflicts with diff views and commit graphs.

Terminal-Based Games

Canvas and buffer access make roguelikes, puzzles and arcade clones possible.

AI-Powered Terminal Applications

Chat clients and agents that stream model output into scrollable, styled panes.

Log Viewers and Editors

Tail, filter and highlight logs or build lightweight editors with community text-area widgets.

07 · download

Download Ratatui for Rust Development

Ratatui is a Rust development library, not a standalone desktop application. There is no installer or executable to download; you add the crate to a Rust project and Cargo fetches it. Explore installation and source information on this site.

Download Ratatui from GitHub

Clone with git clone https://github.com/ratatui/ratatui.git to explore the examples, then run one with cargo run --example followed by its name from the examples folder.

Release Notes and Changelog

Every release on GitHub lists features, fixes and breaking changes. Read them before bumping a minor version, since Ratatui follows 0.x semantic versioning.

Ratatui Documentation and Resources

Combine the API reference on docs.rs, concept guides on ratatui.rs and our documentation overview to learn quickly.

08 · compatibility

Compatibility and Alternatives

With its default crossterm backend, Ratatui supports Windows, Linux and macOS. Other backends include termion, termwiz and termina; termion targets Unix-like systems.

Ratatui 0.30.2 requires Rust 1.88.0 or newer. Terminal color, Unicode and mouse support depend on the terminal emulator. Ratatui gives Rust developers control over rendering and application architecture; alternatives include Bubble Tea for Go and Textual for Python.

09 · troubleshooting

Common Issues

If compilation fails, update Rust with rustup update stable and check the release notes for API changes. For dependency conflicts, use cargo tree -d to find duplicate versions.

Run your application in a real terminal. If rendering flickers, avoid printing to standard output while the interface is active. On Windows, filter keyboard events for presses; enable mouse capture explicitly when needed.

For more guidance, visit the documentation.

10 · requirements

System Requirements

You'll need Rust 1.88.0 or newer, Cargo and a compatible terminal. A UTF-8 terminal with a font that supports box-drawing characters gives the best results.

11 · safety

Safety and Licensing

Ratatui is open source and MIT licensed. Install it from crates.io or the official GitHub repository, keep dependencies updated and review their licenses. Tools such as cargo audit can check dependencies for known advisories.

12 · evaluation

Advantages and Limitations

Ratatui offers customizable widgets, efficient rendering and cross-platform support. It also requires Rust knowledge and leaves input handling and application state to your code. Terminal capabilities can vary across devices.

13 · faq

Frequently Asked Questions About Ratatui

Short, accurate answers to the questions developers ask most. Still stuck? Read the documentation guide or contact us.

Browse examples

Ratatui is used to build terminal user interfaces (TUIs) in Rust: system monitors, deployment dashboards, file managers, database clients, Git tools, log viewers and small games. It handles layout, styling and efficient rendering, while your program owns the data and the event loop.

Yes. Ratatui is free, open-source software released under the MIT license. The source code is developed in public on GitHub, and every release is published to crates.io.

Install Rust with rustup, create a project with cargo new my-app, then run cargo add ratatui inside the project folder. Cargo downloads the crate and its default crossterm backend the next time you build or run.

Yes. With the default crossterm backend, Ratatui applications compile and run on Windows 10 and 11 consoles such as Windows Terminal and PowerShell, as well as on Linux and macOS. The termion backend is the exception: it targets Unix-like systems only.

Ratatui is the community-maintained continuation of tui-rs. It began as a fork in 2023 when tui-rs stopped receiving updates, and tui-rs was later archived. Ratatui keeps the same immediate-mode design but adds years of fixes, new widgets, a modular crate layout and helpers such as ratatui::run().

Ratatui renders the interface; input comes from the backend. With crossterm you read key, mouse, paste, focus and resize events through ratatui::crossterm::event. Mouse reporting must be switched on with EnableMouseCapture.

Ready to build your first terminal app?

Add the crate, copy the Hello World example and you will have a running Ratatui interface in minutes.