Skip to main content

Module scroll

Module scroll 

Source
Expand description

Scroll state and node implementation for cranpose.

This module provides the core scrolling components:

  • ScrollState: Holds scroll position and provides scroll control methods
  • ScrollNode: Layout modifier that applies scroll offset to content
  • ScrollElement: Element for creating ScrollNode instances

The actual Modifier.horizontal_scroll() and Modifier.vertical_scroll() extension methods are defined in modifier/scroll.rs.

Structs§

ScrollElement
Element for creating a ScrollNode.
ScrollNode
ScrollNode layout modifier that physically moves content based on scroll position. This is the component that actually reads ScrollState and applies the visual offset.
ScrollState
State object for scroll position tracking.

Type Aliases§

ScrollSettlePolicy
Remaps where a scroll comes to rest once the user’s interaction ends — the UIScrollView targetContentOffset analog. Receives the naturally proposed rest offset (the fling’s predicted end, or the current offset for a plain release/wheel idle) and the release velocity in offset units/sec; returns the offset the scroll should settle at. Used e.g. by the liquid nav bar to snap out of the large-title collapse band so the title never rests half-faded.