androidx.compose.material3

rememberSearchBarStateSince 1.9Experimental

Function

No hand-written docs yet.

Create and remember a SearchBarState.

ParametersExperimental

@Composable
fun rememberSearchBarState(
    initialValue: SearchBarValue = SearchBarValue.Collapsed,
    animationSpecForExpand: AnimationSpec<Float> = MotionSchemeKeyTokens.SlowSpatial.value(),
    animationSpecForCollapse: AnimationSpec<Float> = MotionSchemeKeyTokens.DefaultSpatial.value(),
): SearchBarState

initialValue: SearchBarValueOptional

Default: SearchBarValue.Collapsed

the initial value of whether the search bar is collapsed or expanded.

animationSpecForExpand: AnimationSpec<Float>Optional

Default: MotionSchemeKeyTokens.SlowSpatial.value()

the animation spec used when the search bar expands.

animationSpecForCollapse: AnimationSpec<Float>Optional

Default: MotionSchemeKeyTokens.DefaultSpatial.value()

the animation spec used when the search bar collapses.

Library docs

Create and remember a SearchBarState.