# rememberContainedSearchBarState

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/rememberContainedSearchBarState.composable#rememberContainedSearchBarState(androidx.compose.material3.SearchBarValue,androidx.compose.animation.core.AnimationSpec,androidx.compose.animation.core.AnimationSpec,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>, animationSpecForContentFadeIn: https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationSpec<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html>, animationSpecForContentFadeOut: 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` to use in conjunction with `https://developer.android.com/reference/kotlin/androidx/compose/material3/ExpandedFullScreenContainedSearchBar.composable#ExpandedFullScreenContainedSearchBar(androidx.compose.material3.SearchBarState,kotlin.Function0,androidx.compose.ui.Modifier,androidx.compose.ui.graphics.Shape,androidx.compose.material3.SearchBarColors,androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp,kotlin.Function0,androidx.compose.ui.window.DialogProperties,kotlin.Function1)`. | Cmn |

## Functions

### rememberContainedSearchBarState

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:rememberContainedSearchBarState)

```
@Composable
fun rememberContainedSearchBarState(
    initialValue: SearchBarValue = SearchBarValue.Collapsed,
    animationSpecForExpand: AnimationSpec<Float> = MotionSchemeKeyTokens.FastSpatial.value(),
    animationSpecForCollapse: AnimationSpec<Float> = MotionSchemeKeyTokens.FastSpatial.value(),
    animationSpecForContentFadeIn: AnimationSpec<Float> = AnimationForContentFadeInSpec,
    animationSpecForContentFadeOut: AnimationSpec<Float> = AnimationForContentFadeOutSpec
): SearchBarState
```

Create and remember a `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarState` to use in conjunction with `https://developer.android.com/reference/kotlin/androidx/compose/material3/ExpandedFullScreenContainedSearchBar.composable#ExpandedFullScreenContainedSearchBar(androidx.compose.material3.SearchBarState,kotlin.Function0,androidx.compose.ui.Modifier,androidx.compose.ui.graphics.Shape,androidx.compose.material3.SearchBarColors,androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp,kotlin.Function0,androidx.compose.ui.window.DialogProperties,kotlin.Function1)`.

| 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.FastSpatial.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.FastSpatial.value()` | the animation spec used when the search bar collapses. |
| `animationSpecForContentFadeIn: https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationSpec<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html> = AnimationForContentFadeInSpec` | the animation spec used for the content when the search bar expands. |
| `animationSpecForContentFadeOut: https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationSpec<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html> = AnimationForContentFadeOutSpec` | the animation spec used for the content when the search bar collapses. |