28 releases (14 stable)

Uses new Rust 2024

2.0.1 Dec 27, 2025
1.5.0 Dec 10, 2025
1.3.1 Nov 6, 2025
1.1.2 Jun 8, 2025
0.12.0 Jul 3, 2024

#897 in Command-line interface

Download history 214/week @ 2025-10-14 153/week @ 2025-10-21 37/week @ 2025-10-28 42/week @ 2025-11-04 187/week @ 2025-11-11 371/week @ 2025-11-18 129/week @ 2025-11-25 378/week @ 2025-12-02 278/week @ 2025-12-09 275/week @ 2025-12-16 193/week @ 2025-12-23 199/week @ 2025-12-30 191/week @ 2026-01-06 219/week @ 2026-01-13 167/week @ 2026-01-20 178/week @ 2026-01-27

785 downloads per month
Used in 23 crates (4 directly)

MIT/Apache

125KB
2K SLoC

semver stable crates.io Documentation License License

This crate is a part of rat-salsa.

For examples see rat-scrolled GitHub

Scroll

Scroll adds support for widgets that want to scroll their content.

Scroll works analogous to Block, it can be set on the widget struct where it is supported. The widget can decide which scrolling it can do, horizontal vertical or both.

Adding scroll to a widget

  • Add Scroll to the widget struct.
  • Use ScrollArea for the layout and rendering of the combination of Block+Scroll+Scroll your widget supports.
  • Add ScrollState to the widget state struct.
  • Use a ScrollAreaState for event-handling.

Examples

For what?

This is for widgets that handle their scrolling internally. They use ScrollState::offset to manage what they have to render. And they set ScrollState::page_len and ScrollState::max_offset to get a correct scrollbar displayed.

Widgets that don't want to do this can be rendered using View or Clipper.

Dependencies

~10–16MB
~311K SLoC