Ratatui vs tui-rs: Architecture and Development Differences

Where the fork came from, what changed in the API and crate layout, and a step-by-step checklist for moving a tui-rs project to Ratatui.

ComparisonsRatatui Editorial Team8 min read
Ratatui vs tui-rs: Architecture and Development Differences featured image

If you search for Rust terminal UI libraries you will meet two names that look almost interchangeable: tui-rs and Ratatui. Older blog posts, Stack Overflow answers and open-source projects use tui-rs, while newer tutorials use Ratatui. This article explains how the two are related, what changed in architecture and API, whether tui-rs is still usable and how to migrate an existing codebase with minimal effort.

Facts about the current release are checked against crates.io metadata for Ratatui 0.30.2. Ratatui code in this article compiles against that version; tui-rs snippets are shown for comparison only.

A Short History: From tui-rs to Ratatui

tui-rs was created by Florian Dehau and became the go-to crate for terminal dashboards in Rust. Its immediate-mode design, flexible layout engine and widget set powered many well-known command-line tools. Over time, however, maintenance slowed. Issues and pull requests accumulated, and users had no clear path for getting fixes released.

In early 2023 a group of contributors forked the project under the name Ratatui to keep it moving. They continued the version numbering from 0.20, merged long-pending fixes and set up a regular release process. Later in 2023 the original repository was archived with a notice directing users to Ratatui. Since then Ratatui has been the actively maintained continuation, with its own GitHub organization, documentation website, templates and a growing set of companion crates.

In other words, the comparison is not between two competing libraries. It is between an archived project and its maintained successor.

What Stayed the Same

The core ideas carried over unchanged, which is why migration is usually painless:

  • Immediate-mode rendering. Your app describes the whole screen on every frame; the library diffs buffers and writes only changes.
  • The Terminal, Frame and Buffer model. You call terminal.draw(), receive a frame and render widgets into rectangles.
  • Constraint-based layout. Areas are split with length, percentage, ratio, minimum and maximum constraints.
  • Widget traits. Widget and StatefulWidget work as before, so custom widgets port with few edits.
  • Backend independence. crossterm and termion remain supported, and you still own the event loop.

Architecture and API Differences

Ratatui has accumulated years of improvements. The table summarizes the differences you will notice most:

tui-rs and Ratatui compared
Areatui-rs (archived)Ratatui 0.30.2
MaintenanceArchived, no new releasesActively maintained with regular releases
Crate layoutSingle crateWorkspace: ratatui-core, ratatui-widgets, backend crates, macros; ratatui re-exports all
Terminal setupManual raw mode and alternate screen coderatatui::run(), init() and restore() with a panic hook
Backendscrossterm, termioncrossterm (default), termion, termwiz, termina, plus TestBackend
LayoutConstraints and split()Adds Fill, Flex alignment, spacing, .areas() destructuring and a layout cache
Text stylingSpans and Style buildersLine, Span, Text with the Stylize shorthand trait
WidgetsCore setAdds Scrollbar, Calendar, richer Table highlighting, block shadows and more
MSRV policyOlder toolchainsDocumented; currently Rust 1.88.0
DocumentationAPI docsAPI docs plus ratatui.rs tutorials, recipes and release highlights

Terminal setup got much shorter

A typical tui-rs program spent fifteen or more lines enabling raw mode, entering the alternate screen, creating a backend and then reversing it all, often forgetting panic safety. Ratatui condenses this into one call:

Before: tui-rs style
// tui-rs era: manual setup and teardown (for comparison, does not use Ratatui)
enable_raw_mode()?;
let mut stdout = io::stdout();
execute!(stdout, EnterAlternateScreen, EnableMouseCapture)?;
let backend = CrosstermBackend::new(stdout);
let mut terminal = Terminal::new(backend)?;
let res = run_app(&mut terminal);
disable_raw_mode()?;
execute!(terminal.backend_mut(), LeaveAlternateScreen, DisableMouseCapture)?;
terminal.show_cursor()?;
After: Ratatui
use ratatui::widgets::Paragraph;

fn main() -> std::io::Result<()> {
    ratatui::run(|terminal| {
        terminal.draw(|frame| {
            frame.render_widget(Paragraph::new("Hello from Ratatui"), frame.area());
        })?;
        ratatui::crossterm::event::read()?;
        Ok(())
    })
}

Renamed and improved APIs

Some names changed as the API matured. Spans became Line, Frame::size() became Frame::area(), and the table highlight method is now row_highlight_style. Layout gained the Fill constraint and Flex modes for positioning leftover space, and you can destructure areas directly: let [left, right] = Layout::horizontal([...]).areas(area);. Collections gained convenience methods such as ListState::select_next(), and blocks can carry titles at the top and bottom with independent alignment.

A modular workspace

Version 0.30 split Ratatui into focused crates. Application developers still depend on ratatui and see no difference, but widget library authors can depend on ratatui-core, which changes less often. That reduces the version churn that used to force every widget crate to release whenever the main crate did.

Testing Support Compared

Both libraries include a TestBackend that renders into memory, but Ratatui has invested more in testing ergonomics. Buffers implement readable debug output, Buffer::with_lines builds expected screens from plain strings, and helpers such as assert_buffer_lines on the test backend make snapshot-style assertions short. Combined with a deterministic immediate-mode design, that means you can lock down the look of your interface with ordinary unit tests and catch regressions in pull requests.

Is tui-rs Still Usable?

Archived crates keep working: existing projects that depend on tui-rs will still compile as long as their dependency tree resolves. The problem is the future. Bugs will not be fixed, compatibility with newer backend versions is frozen, and third-party widget crates have moved to Ratatui. For any new project, Ratatui is the clear choice, and for maintained projects a migration pays off quickly in fixes and new features.

Migration Checklist: Moving from tui-rs to Ratatui

  1. Replace the dependency. Remove tui from Cargo.toml and run cargo add ratatui. If you used crossterm directly, consider importing it through ratatui::crossterm instead.
  2. Optionally alias the crate. For very large codebases you can temporarily keep the old name with a package rename, then switch imports gradually.
  3. Update imports. Replace tui:: with ratatui:: across the project; a project-wide search and replace handles most cases.
  4. Fix renamed items. Let the compiler guide you: Spans to Line, size() to area(), highlight style renames and similar. Deprecation warnings usually name the replacement.
  5. Simplify terminal setup. Replace manual setup and teardown with ratatui::run() or init()/restore() to gain panic safety.
  6. Raise your toolchain. Ratatui 0.30.2 needs Rust 1.88.0 or newer. Run rustup update.
  7. Run your tests and the app. Check rendering in a real terminal, especially custom widgets and tables.
Cargo.toml alias (optional)
[dependencies]
# Temporary alias: keeps `use tui::...` compiling while you migrate
tui = { package = "ratatui", version = "0.30.2" }

The alias is a convenience, not a destination. Once the code compiles, switch to the plain ratatui name so new contributors are not confused.

Common Migration Pitfalls

  • Two crossterm versions. If your project depends on an old crossterm directly, event types will not match Ratatui's. Remove the direct dependency or align versions; Ratatui also offers crossterm_0_28 and crossterm_0_29 features for matching.
  • Third-party widgets. Crates built for tui-rs need Ratatui-compatible releases. Check their documentation, or vendor and port small ones.
  • Behavioral defaults. Some defaults changed over the years, such as table highlight styles and paragraph alignment inheritance. Compare screenshots before and after migration.
  • Skipping intermediate notes. Jumping from tui-rs 0.19 to Ratatui 0.30 crosses many releases. Skim the project's breaking-changes document for each section that mentions APIs you use.

Our troubleshooting guide covers the compiler errors you are most likely to meet during this process.

Ecosystem and Community Differences

Beyond the code, the biggest practical difference is the ecosystem around each project. Ratatui has an official website with tutorials, concept explanations and recipes, release highlights for every version, project templates you can generate with cargo generate, and an active community chat where maintainers answer questions. Third-party crates for text areas, tree views, image rendering, popups and animation effects target Ratatui directly. The modular 0.30 layout also gives widget authors a smaller, more stable dependency in ratatui-core.

tui-rs, by contrast, has a frozen ecosystem. Widget crates that once supported it have mostly moved on, and new learning resources are written for Ratatui. When you weigh the two, consider not only today's code but also how easily you will find help, examples and compatible libraries a year from now.

Which One Should You Choose?

Choose Ratatui. It is a drop-in successor with the same mental model, active maintenance, better ergonomics, more widgets and a living ecosystem. The only reason to stay on tui-rs is a frozen legacy project that will never change, and even then, a migration is often an afternoon's work.

Frequently Asked Questions

Yes. Ratatui started in 2023 as a community fork of tui-rs and has since become its maintained successor. The original tui-rs repository is archived and points to Ratatui.

Not directly, because the traits live in a different crate. Most widget crates have published Ratatui versions, and small widgets can be ported by changing imports.

Ratatui continued the numbering from 0.20, after tui-rs 0.19. That is why there is no Ratatui 0.1 to 0.19.

Small apps often migrate in under an hour. Large projects take longer mainly because of renamed APIs and third-party widgets, but the compiler points to every place that needs a change.

Mostly in concept, not perfectly in API. Core types and traits are familiar, but some items were renamed or reworked, so expect a round of compiler-guided edits.

Conclusion

Ratatui is not a competitor to tui-rs; it is tui-rs continued by its community. The rendering model, layout system and widget traits are familiar, while setup helpers, renamed APIs, new widgets and a modular crate layout make day-to-day work easier. Follow the checklist above, lean on compiler messages, and consult the official Ratatui repository for detailed release notes. To get started fresh, read how to build your first terminal application, or see how Ratatui compares with libraries in other languages in Ratatui vs Bubble Tea vs Textual.

Ratatui Editorial Team

We write tested guides for Rust developers building terminal user interfaces. Every code sample in this article was compiled against Ratatui 0.30.2. Spotted an issue? Let us know.