# rememberSearchBarState

Common/AllAndroid/JVM

## Functions summary

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarState` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/compose/material3/rememberSearchBarState.composable#rememberSearchBarState(androidx.compose.material3.SearchBarValue,androidx.compose.animation.core.AnimationSpec,androidx.compose.animation.core.AnimationSpec)( initialValue: https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarValue, animationSpecForExpand: https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationSpec<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html>, animationSpecForCollapse: https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationSpec<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html> )` Create and remember a `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarState`. | Cmn |

## Functions

### rememberSearchBarState

Cmn Artifact: [androidx.compose.material3:material3](https://developer.android.com/jetpack/androidx/releases/compose-material3) [View Source](https://cs.android.com/search?q=file:androidx/compose/material3/SearchBar.kt+function:rememberSearchBarState)

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

Create and remember a `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarState`.

| Parameters |
|---|---|
| `initialValue: https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarValue = SearchBarValue.Collapsed` | the initial value of whether the search bar is collapsed or expanded. |
| `animationSpecForExpand: https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationSpec<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html> = MotionSchemeKeyTokens.SlowSpatial.value()` | the animation spec used when the search bar expands. |
| `animationSpecForCollapse: https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationSpec<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html> = MotionSchemeKeyTokens.DefaultSpatial.value()` | the animation spec used when the search bar collapses. |