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
279 downloads per month
Used in 19 crates
(13 directly)
2MB
45K
SLoC
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
Dependencies
~17–27MB
~481K SLoC