25 releases (15 breaking)

new 0.34.0 Jan 5, 2025
0.32.0 Dec 29, 2024
0.30.0 Nov 1, 2024
0.13.0 Jul 3, 2024

#1094 in Command-line interface

Download history 55/week @ 2024-09-18 49/week @ 2024-09-25 119/week @ 2024-10-02 229/week @ 2024-10-09 600/week @ 2024-10-16 62/week @ 2024-10-23 156/week @ 2024-10-30 8/week @ 2024-11-06 3/week @ 2024-11-13 7/week @ 2024-11-20 15/week @ 2024-11-27 148/week @ 2024-12-04 272/week @ 2024-12-11 32/week @ 2024-12-18 117/week @ 2024-12-25 503/week @ 2025-01-01

962 downloads per month
Used in 2 crates

MIT/Apache

1.5MB
34K SLoC

beta 3 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.

Speed

Rendering all the widgets tries hard not to need allocations and extensive copying during rendering.

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 and the (experimental) StatefulWidgetRef traits.

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

and some adapters for ratatui widgets

Layout

There are some layout calculators beyond ratatui's Layout.

Dependencies

~11–22MB
~294K SLoC