rememberSearchBarState

Composable Function

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

Create and remember a SearchBarState.

Parameters

initialValuethe initial value of whether the search bar is collapsed or expanded.
animationSpecForExpandthe animation spec used when the search bar expands.
animationSpecForCollapsethe animation spec used when the search bar collapses.