NestedScrollAware

Visibility state driven by vertical nested-scroll gestures.

Attach nestedScrollConnection to the scrolling container with Modifier.nestedScroll. Upward content scrolling hides the element after thresholdPx has accumulated; downward content scrolling shows it again after the same distance. A direction change resets the accumulated distance so small opposing movements do not unexpectedly toggle visibility.

Create instances with rememberNestedScrollAwareVisibilityState, which converts the public dp threshold to pixels for the current density.

Properties

Link copied to clipboard

Connection to attach to the scrolling container.

Link copied to clipboard

Scroll distance in pixels required before visibility changes.

Link copied to clipboard

Whether the controlled element is currently visible.

Functions

Link copied to clipboard

Returns the current visibility state as a boolean, observing any reactive sources (such as VisibilityState.ScrollAware.scrollState) as needed.