Skip to main content

Module scroll_area

Module scroll_area 

Source
Expand description

ScrollArea — a clipping viewport that scrolls its content on wheel, touch, and assistive-technology actions.

Wrap any widget in ScrollArea to make it scrollable. The scroll position is stored in reactive Signal<f32> signals (one per axis), shared with the built-in ScrollBar children. Two display modes cover most use cases: Overlay (the default, macOS-style thin-at-rest indicator that expands on hover) and Permanent (a layout-consuming gutter always on screen). Use ScrollBarPolicy to control when each axis shows.

§Accessibility

Reports Role::ScrollView with per-axis scroll_y / scroll_x position and limit fields. Advertises ScrollUp / ScrollDown / ScrollLeft / ScrollRight actions only for the axes that actually overflow, so AT clients (NVDA, JAWS, VoiceOver) know which directions are reachable.

let _w = ScrollArea::new()
    .child(MinSize::new(0.0, 2000.0))
    .scroll_bar_style(ScrollBarMode::Permanent)
    .smooth_scrolling(true);

Structs§

ScrollArea
A clipping viewport that makes any child widget scrollable.

Enums§

ScrollBarMode
How the scroll bar is presented relative to the viewport content.
ScrollBarPolicy
Controls when the scroll bar appears for a given axis.