androidx.compose.material3

SearchBarScrollBehaviorSince 1.9Experimental

Interface

No hand-written docs yet.

A SearchBarScrollBehavior defines how a search bar should behave when the content beneath it is scrolled.

interface SearchBarScrollBehavior

How to get one

Ready-made values and functions that return it

Used by

Parameters that take a SearchBarScrollBehavior.

Properties

scrollOffset

val scrollOffset: Float

The search bar's current offset due to scrolling, in pixels. This offset is applied to the fixed size of the search bar to control the displayed size when content is being scrolled.

scrollOffsetLimit

val scrollOffsetLimit: Float

The limit that a search bar can be offset due to scrolling, in pixels.

contentOffsetSince 1.10

val contentOffset: Float

The total offset of the content scrolled under the search bar.

nestedScrollConnection

val nestedScrollConnection: NestedScrollConnection

A NestedScrollConnection that should be attached to a androidx.compose.ui.input.nestedscroll.nestedScroll in order to keep track of scroll events.

Functions

searchBarScrollBehavior

fun Modifier.searchBarScrollBehavior(): Modifier

The modifier that adds scrolling behavior to the search bar component. AppBarWithSearch applies this automatically.

Library docs

A SearchBarScrollBehavior defines how a search bar should behave when the content beneath it is scrolled.