Skip to main content

Module state

Module state 

Source
Expand description

Reusable widget state, kept separate from drawing.

Widgets in this crate retain no state of their own (see the crate docs). But something still has to remember which item is selected and how far a list has scrolled between frames: that’s app state, not widget state, and ListState is a small, tested, headless (no Backend dependency) building block for it so every consumer doesn’t hand-roll its own selection-cursor math.

Structs§

ListState
Selection index and scroll offset for a selectable, scrollable list.
ScrollPhysics
Configurable physics constants for ScrollState.
ScrollState
Scroll state for smooth, momentum-based scrolling with rubber-banding.
TextInputState
A String value, a byte cursor into it, and a horizontal scroll offset.

Enums§

SelectionWrap
How ListState::select_next/select_previous behave when the selection is already at the first/last item.