62 releases (32 stable)

Uses new Rust 2024

3.2.1 Mar 9, 2026
3.1.1 Jan 26, 2026
3.0.2 Dec 27, 2025
2.11.0 Dec 27, 2025
0.13.0 Jul 3, 2024

#269 in Command-line interface

Download history 117/week @ 2025-12-28 9/week @ 2026-01-04 2/week @ 2026-01-11 3/week @ 2026-01-25 6/week @ 2026-02-01 46/week @ 2026-02-08 190/week @ 2026-02-15 104/week @ 2026-02-22 114/week @ 2026-03-01 91/week @ 2026-03-08 212/week @ 2026-03-15 46/week @ 2026-03-22 69/week @ 2026-03-29 58/week @ 2026-04-05 76/week @ 2026-04-12

279 downloads per month
Used in 19 crates (13 directly)

MIT/Apache

2MB
45K SLoC

semver stable crates.io Documentation License License

This crate is a part of rat-salsa.

For examples see rat-widget GitHub

Rat Widgets

This crate tries to provide an extended set of widgets with

  • Event handling
  • Focus handling
  • Builtin scrolling
  • Speed

Event handling

Uses the trait defined in rat-event to implement event-handling for crossterm. All widgets are designed with other event-handlers in mind.

Focus handling

Uses FocusFlag defined by rat-focus internally, to mark the focused widget. This is just a passive flag, that probably can be used with other focus systems. Or you use rat-focus.

Scrolling

Where it makes sense the widgets implement internal scrolling. They use Scroll from rat-scrolled to render the scroll bars.

Speed

When rendering all the widgets try hard to do so without allocations and extensive copying.

Special mentions:

  • rat-ftable::Table: It uses an adapter for the data for rendering instead of creating Row/Cell structs.

Widgets

All the widgets are plain ratatui widgets, and implement StatefulWidget.

Event handling uses rat-event::HandleEvent. Currently, crossterm events are implemented.

Layout

There are some layout calculators beyond ratatui's Layout.

Relocation

Widgets like View and Clipper move the widget-image after rendering. This breaks any areas stored in the widget-states.

See rat-reloc

Extras

A collections of uncommon widgets

rat-widget-extra

Dependencies

~17–27MB
~481K SLoC