# SearchBarDefaults

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+class:androidx.compose.material3.SearchBarDefaults) Common/AllAndroid/JVM
- Cmn

  ```
  object SearchBarDefaults
  ```

*** ** * ** ***

Defaults used in `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBar.composable#SearchBar(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)` and `https://developer.android.com/reference/kotlin/androidx/compose/material3/DockedSearchBar.composable#DockedSearchBar(kotlin.Function0,kotlin.Boolean,kotlin.Function1,androidx.compose.ui.Modifier,androidx.compose.ui.graphics.Shape,androidx.compose.material3.SearchBarColors,androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp,kotlin.Function1)`.

## Summary

| ### Public functions |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/compose/material3/ExperimentalMaterial3Api @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable [InputField](https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarDefaults#InputField(kotlin.String,kotlin.Function1,kotlin.Function1,kotlin.Boolean,kotlin.Function1,androidx.compose.ui.Modifier,kotlin.Boolean,kotlin.Function0,kotlin.Function0,kotlin.Function0,androidx.compose.material3.TextFieldColors,androidx.compose.foundation.interaction.MutableInteractionSource))( query: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, onQueryChange: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html, onSearch: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html, expanded: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, onExpandedChange: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html, modifier: https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier, enabled: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, placeholder: (@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)?, leadingIcon: (@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)?, trailingIcon: (@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)?, colors: https://developer.android.com/reference/kotlin/androidx/compose/material3/TextFieldColors, interactionSource: https://developer.android.com/reference/kotlin/androidx/compose/foundation/interaction/MutableInteractionSource? )` **This function is deprecated.** Use SearchBarDefaults.InputField with TextFieldState and SearchBarState. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/compose/material3/ExperimentalMaterial3Api @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable [InputField](https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarDefaults#InputField(androidx.compose.foundation.text.input.TextFieldState,kotlin.Function1,kotlin.Boolean,kotlin.Function1,androidx.compose.ui.Modifier,kotlin.Boolean,kotlin.Boolean,androidx.compose.ui.text.TextStyle,kotlin.Function0,kotlin.Function0,kotlin.Function0,kotlin.Function0,kotlin.Function0,androidx.compose.foundation.text.input.InputTransformation,androidx.compose.foundation.text.input.OutputTransformation,androidx.compose.foundation.ScrollState,androidx.compose.ui.graphics.Shape,androidx.compose.material3.TextFieldColors,androidx.compose.foundation.interaction.MutableInteractionSource))( state: https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/TextFieldState, onSearch: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html, expanded: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, onExpandedChange: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html, modifier: https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier, enabled: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, readOnly: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, textStyle: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle, placeholder: (@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)?, leadingIcon: (@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)?, trailingIcon: (@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)?, prefix: (@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)?, suffix: (@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)?, inputTransformation: https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/InputTransformation?, outputTransformation: https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/OutputTransformation?, scrollState: https://developer.android.com/reference/kotlin/androidx/compose/foundation/ScrollState, shape: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Shape, colors: https://developer.android.com/reference/kotlin/androidx/compose/material3/TextFieldColors, interactionSource: https://developer.android.com/reference/kotlin/androidx/compose/foundation/interaction/MutableInteractionSource? )` **This function is deprecated.** Use SearchBarDefaults.InputField with SearchBarState. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarDefaults#InputField(androidx.compose.foundation.text.input.TextFieldState,androidx.compose.material3.SearchBarState,kotlin.Function1,androidx.compose.ui.Modifier,kotlin.Boolean,kotlin.Boolean,androidx.compose.ui.text.TextStyle,kotlin.Function0,kotlin.Function0,kotlin.Function0,kotlin.Function0,kotlin.Function0,androidx.compose.foundation.text.input.InputTransformation,androidx.compose.foundation.text.input.OutputTransformation,androidx.compose.foundation.ScrollState,androidx.compose.ui.graphics.Shape,androidx.compose.material3.TextFieldColors,androidx.compose.foundation.interaction.MutableInteractionSource,androidx.compose.foundation.text.KeyboardOptions,androidx.compose.foundation.text.input.TextFieldLineLimits)( textFieldState: https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/TextFieldState, searchBarState: https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarState, onSearch: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html, modifier: https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier, enabled: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, readOnly: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, textStyle: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle, placeholder: (@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)?, leadingIcon: (@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)?, trailingIcon: (@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)?, prefix: (@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)?, suffix: (@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)?, inputTransformation: https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/InputTransformation?, outputTransformation: https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/OutputTransformation?, scrollState: https://developer.android.com/reference/kotlin/androidx/compose/foundation/ScrollState, shape: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Shape, colors: https://developer.android.com/reference/kotlin/androidx/compose/material3/TextFieldColors, interactionSource: https://developer.android.com/reference/kotlin/androidx/compose/foundation/interaction/MutableInteractionSource?, keyboardOptions: https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/KeyboardOptions, lineLimits: https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/TextFieldLineLimits )` A text field to input a query in a search bar. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/material3/AppBarWithSearchColors` | `@https://developer.android.com/reference/kotlin/androidx/compose/material3/ExperimentalMaterial3Api @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarDefaults#appBarWithSearchColors(androidx.compose.material3.SearchBarColors,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color)( searchBarColors: https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarColors, scrolledSearchBarContainerColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, appBarContainerColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, scrolledAppBarContainerColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, appBarNavigationIconColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, appBarActionIconColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color )` Creates an `https://developer.android.com/reference/kotlin/androidx/compose/material3/AppBarWithSearchColors` that represents the different colors used in parts of the `https://developer.android.com/reference/kotlin/androidx/compose/material3/AppBarWithSearch.composable#AppBarWithSearch(androidx.compose.material3.SearchBarState,kotlin.Function0,androidx.compose.ui.Modifier,kotlin.Function0,kotlin.Function1,androidx.compose.ui.graphics.Shape,androidx.compose.material3.AppBarWithSearchColors,androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp,androidx.compose.foundation.layout.PaddingValues,androidx.compose.foundation.layout.WindowInsets,androidx.compose.material3.SearchBarScrollBehavior)`. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarColors` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarDefaults#colors(androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.material3.TextFieldColors)( containerColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, dividerColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, inputFieldColors: https://developer.android.com/reference/kotlin/androidx/compose/material3/TextFieldColors )` Creates a `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarColors` that represents the different colors used in parts of the search bar. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarColors` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarDefaults#containedColors(androidx.compose.material3.SearchBarState)(state: https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarState)` Creates a `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarColors` that represents the different colors used in parts of the search bar based on `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarState`. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarScrollBehavior` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarDefaults#enterAlwaysSearchBarScrollBehavior(androidx.compose.material3.SearchBarScrollState,kotlin.Function0,androidx.compose.animation.core.AnimationSpec,androidx.compose.animation.core.DecayAnimationSpec,kotlin.Boolean)( scrollState: https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarScrollState, canScroll: () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, snapAnimationSpec: https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationSpec<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html>, flingAnimationSpec: https://developer.android.com/reference/kotlin/androidx/compose/animation/core/DecayAnimationSpec<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html>, reverseLayout: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` Returns a `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarScrollBehavior`. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarScrollBehavior` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable [enterAlwaysSearchBarScrollBehavior](https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarDefaults#enterAlwaysSearchBarScrollBehavior(kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Function0,androidx.compose.animation.core.AnimationSpec,androidx.compose.animation.core.DecayAnimationSpec,kotlin.Boolean))( initialOffset: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, initialOffsetLimit: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, initialContentOffset: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, canScroll: () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, snapAnimationSpec: https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationSpec<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html>, flingAnimationSpec: https://developer.android.com/reference/kotlin/androidx/compose/animation/core/DecayAnimationSpec<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html>, reverseLayout: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` **This function is deprecated.** Use \`enterAlwaysSearchBarScrollBehavior\` that accepts a \`SearchBarScrollState\` parameter. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/material3/TextFieldColors` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarDefaults#inputFieldColors(androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.foundation.text.selection.TextSelectionColors,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color)( focusedTextColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, unfocusedTextColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, disabledTextColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, cursorColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, selectionColors: https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/selection/TextSelectionColors, focusedLeadingIconColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, unfocusedLeadingIconColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, disabledLeadingIconColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, focusedTrailingIconColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, unfocusedTrailingIconColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, disabledTrailingIconColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, focusedPlaceholderColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, unfocusedPlaceholderColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, disabledPlaceholderColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, focusedPrefixColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, unfocusedPrefixColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, disabledPrefixColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, focusedSuffixColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, unfocusedSuffixColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, disabledSuffixColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, focusedContainerColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, unfocusedContainerColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, disabledContainerColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color )` Creates a `https://developer.android.com/reference/kotlin/androidx/compose/material3/TextFieldColors` that represents the different colors used in the search bar input field in different states. | Cmn |

| ### Public properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/PaddingValues` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarDefaults#AppBarContentPadding()` Default padding used for `https://developer.android.com/reference/kotlin/androidx/compose/material3/AppBarWithSearch.composable#AppBarWithSearch(androidx.compose.material3.SearchBarState,kotlin.Function0,androidx.compose.ui.Modifier,kotlin.Function0,kotlin.Function1,androidx.compose.ui.graphics.Shape,androidx.compose.material3.AppBarWithSearchColors,androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp,androidx.compose.foundation.layout.PaddingValues,androidx.compose.foundation.layout.WindowInsets,androidx.compose.material3.SearchBarScrollBehavior)` content | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarDefaults#Elevation()` **This property is deprecated.** Renamed to TonalElevation. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarDefaults#InputFieldHeight()` Default height for a search bar's input field, or a search bar in the unexpanded state. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarDefaults#ShadowElevation()` Default shadow elevation for a search bar. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarDefaults#TonalElevation()` Default tonal elevation for a search bar. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarDefaults#collapsedContainedSearchBarColor()` Default container color for an `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)` in the collapsed state. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarDefaults#dockedDropdownGapSize()` Default gap size for a drop-down attached to a `https://developer.android.com/reference/kotlin/androidx/compose/material3/DockedSearchBar.composable#DockedSearchBar(kotlin.Function0,kotlin.Boolean,kotlin.Function1,androidx.compose.ui.Modifier,androidx.compose.ui.graphics.Shape,androidx.compose.material3.SearchBarColors,androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp,kotlin.Function1)`. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarDefaults#dockedDropdownScrimColor()` Default scrim color for a drop-down attached to a `https://developer.android.com/reference/kotlin/androidx/compose/material3/DockedSearchBar.composable#DockedSearchBar(kotlin.Function0,kotlin.Boolean,kotlin.Function1,androidx.compose.ui.Modifier,androidx.compose.ui.graphics.Shape,androidx.compose.material3.SearchBarColors,androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp,kotlin.Function1)`. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Shape` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarDefaults#dockedDropdownShape()` Default shape for a drop-down containing search results attached to a `https://developer.android.com/reference/kotlin/androidx/compose/material3/DockedSearchBar.composable#DockedSearchBar(kotlin.Function0,kotlin.Boolean,kotlin.Function1,androidx.compose.ui.Modifier,androidx.compose.ui.graphics.Shape,androidx.compose.material3.SearchBarColors,androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp,kotlin.Function1)`. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Shape` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarDefaults#dockedShape()` Default shape for a `https://developer.android.com/reference/kotlin/androidx/compose/material3/DockedSearchBar.composable#DockedSearchBar(kotlin.Function0,kotlin.Boolean,kotlin.Function1,androidx.compose.ui.Modifier,androidx.compose.ui.graphics.Shape,androidx.compose.material3.SearchBarColors,androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp,kotlin.Function1)`. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarDefaults#fullScreenContainedSearchBarColor()` Default container color for an `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)` in the expanded state. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Shape` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarDefaults#fullScreenShape()` Default shape for a `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBar.composable#SearchBar(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)` in the expanded state. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/WindowInsets` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarDefaults#fullScreenWindowInsets()` Default window insets used and consumed by `https://developer.android.com/reference/kotlin/androidx/compose/material3/ExpandedFullScreenSearchBar.composable#ExpandedFullScreenSearchBar(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 |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Shape` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarDefaults#inputFieldShape()` Default shape for a search bar's input field, or a search bar in the unexpanded state. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/WindowInsets` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarDefaults#windowInsets()` Default window insets for an `https://developer.android.com/reference/kotlin/androidx/compose/material3/AppBarWithSearch.composable#AppBarWithSearch(androidx.compose.material3.SearchBarState,kotlin.Function0,androidx.compose.ui.Modifier,kotlin.Function0,kotlin.Function1,androidx.compose.ui.graphics.Shape,androidx.compose.material3.AppBarWithSearchColors,androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp,androidx.compose.foundation.layout.PaddingValues,androidx.compose.foundation.layout.WindowInsets,androidx.compose.material3.SearchBarScrollBehavior)`. | Cmn |

## Public functions

### InputField

Cmn

```
@ExperimentalMaterial3Api
@Composable
fun [InputField](https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarDefaults#InputField(kotlin.String,kotlin.Function1,kotlin.Function1,kotlin.Boolean,kotlin.Function1,androidx.compose.ui.Modifier,kotlin.Boolean,kotlin.Function0,kotlin.Function0,kotlin.Function0,androidx.compose.material3.TextFieldColors,androidx.compose.foundation.interaction.MutableInteractionSource))(
    query: String,
    onQueryChange: (String) -> Unit,
    onSearch: (String) -> Unit,
    expanded: Boolean,
    onExpandedChange: (Boolean) -> Unit,
    modifier: Modifier = Modifier,
    enabled: Boolean = true,
    placeholder: (@Composable () -> Unit)? = null,
    leadingIcon: (@Composable () -> Unit)? = null,
    trailingIcon: (@Composable () -> Unit)? = null,
    colors: TextFieldColors = inputFieldColors(),
    interactionSource: MutableInteractionSource? = null
): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
> Use SearchBarDefaults.InputField with TextFieldState and SearchBarState.

A text field to input a query in a search bar.

This overload of `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarDefaults#InputField(kotlin.String,kotlin.Function1,kotlin.Function1,kotlin.Boolean,kotlin.Function1,androidx.compose.ui.Modifier,kotlin.Boolean,kotlin.Function0,kotlin.Function0,kotlin.Function0,androidx.compose.material3.TextFieldColors,androidx.compose.foundation.interaction.MutableInteractionSource)` takes a `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarDefaults#InputField(kotlin.String,kotlin.Function1,kotlin.Function1,kotlin.Boolean,kotlin.Function1,androidx.compose.ui.Modifier,kotlin.Boolean,kotlin.Function0,kotlin.Function0,kotlin.Function0,androidx.compose.material3.TextFieldColors,androidx.compose.foundation.interaction.MutableInteractionSource)` and `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarDefaults#InputField(kotlin.String,kotlin.Function1,kotlin.Function1,kotlin.Boolean,kotlin.Function1,androidx.compose.ui.Modifier,kotlin.Boolean,kotlin.Function0,kotlin.Function0,kotlin.Function0,androidx.compose.material3.TextFieldColors,androidx.compose.foundation.interaction.MutableInteractionSource)` callback to keep track of the text content. Consider using the overload which takes a `https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/TextFieldState` instead.

| Parameters |
|---|---|
| `query: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | the query text to be shown in the input field. |
| `onQueryChange: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | the callback to be invoked when the input service updates the query. An updated text comes as a parameter of the callback. |
| `onSearch: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | the callback to be invoked when the input service triggers the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/ImeAction#Search()` action. The current `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarDefaults#InputField(kotlin.String,kotlin.Function1,kotlin.Function1,kotlin.Boolean,kotlin.Function1,androidx.compose.ui.Modifier,kotlin.Boolean,kotlin.Function0,kotlin.Function0,kotlin.Function0,androidx.compose.material3.TextFieldColors,androidx.compose.foundation.interaction.MutableInteractionSource)` comes as a parameter of the callback. |
| `expanded: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | whether the search bar is expanded and showing search results. |
| `onExpandedChange: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | the callback to be invoked when the search bar's expanded state is changed. |
| `modifier: https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier = Modifier` | the `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier` to be applied to this input field. |
| `enabled: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html = true` | the enabled state of this input field. When `false`, this component will not respond to user input, and it will appear visually disabled and disabled to accessibility services. |
| `placeholder: (@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)? = null` | the placeholder to be displayed when the `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarDefaults#InputField(kotlin.String,kotlin.Function1,kotlin.Function1,kotlin.Boolean,kotlin.Function1,androidx.compose.ui.Modifier,kotlin.Boolean,kotlin.Function0,kotlin.Function0,kotlin.Function0,androidx.compose.material3.TextFieldColors,androidx.compose.foundation.interaction.MutableInteractionSource)` is empty. |
| `leadingIcon: (@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)? = null` | the leading icon to be displayed at the start of the input field. |
| `trailingIcon: (@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)? = null` | the trailing icon to be displayed at the end of the input field. |
| `colors: https://developer.android.com/reference/kotlin/androidx/compose/material3/TextFieldColors = inputFieldColors()` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/TextFieldColors` that will be used to resolve the colors used for this input field in different states. See `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarDefaults#inputFieldColors(androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.foundation.text.selection.TextSelectionColors,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color)`. |
| `interactionSource: https://developer.android.com/reference/kotlin/androidx/compose/foundation/interaction/MutableInteractionSource? = null` | an optional hoisted `https://developer.android.com/reference/kotlin/androidx/compose/foundation/interaction/MutableInteractionSource` for observing and emitting `https://developer.android.com/reference/kotlin/androidx/compose/foundation/interaction/Interaction`s for this input field. You can use this to change the search bar's appearance or preview the search bar in different states. Note that if `null` is provided, interactions will still happen internally. |

### InputField

Cmn

```
@ExperimentalMaterial3Api
@Composable
fun [InputField](https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarDefaults#InputField(androidx.compose.foundation.text.input.TextFieldState,kotlin.Function1,kotlin.Boolean,kotlin.Function1,androidx.compose.ui.Modifier,kotlin.Boolean,kotlin.Boolean,androidx.compose.ui.text.TextStyle,kotlin.Function0,kotlin.Function0,kotlin.Function0,kotlin.Function0,kotlin.Function0,androidx.compose.foundation.text.input.InputTransformation,androidx.compose.foundation.text.input.OutputTransformation,androidx.compose.foundation.ScrollState,androidx.compose.ui.graphics.Shape,androidx.compose.material3.TextFieldColors,androidx.compose.foundation.interaction.MutableInteractionSource))(
    state: TextFieldState,
    onSearch: (String) -> Unit,
    expanded: Boolean,
    onExpandedChange: (Boolean) -> Unit,
    modifier: Modifier = Modifier,
    enabled: Boolean = true,
    readOnly: Boolean = false,
    textStyle: TextStyle = LocalTextStyle.current,
    placeholder: (@Composable () -> Unit)? = null,
    leadingIcon: (@Composable () -> Unit)? = null,
    trailingIcon: (@Composable () -> Unit)? = null,
    prefix: (@Composable () -> Unit)? = null,
    suffix: (@Composable () -> Unit)? = null,
    inputTransformation: InputTransformation? = null,
    outputTransformation: OutputTransformation? = null,
    scrollState: ScrollState = rememberScrollState(),
    shape: Shape = inputFieldShape,
    colors: TextFieldColors = inputFieldColors(),
    interactionSource: MutableInteractionSource? = null
): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
> Use SearchBarDefaults.InputField with SearchBarState.

A text field to input a query in a search bar.

This overload of `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarDefaults#InputField(androidx.compose.foundation.text.input.TextFieldState,kotlin.Function1,kotlin.Boolean,kotlin.Function1,androidx.compose.ui.Modifier,kotlin.Boolean,kotlin.Boolean,androidx.compose.ui.text.TextStyle,kotlin.Function0,kotlin.Function0,kotlin.Function0,kotlin.Function0,kotlin.Function0,androidx.compose.foundation.text.input.InputTransformation,androidx.compose.foundation.text.input.OutputTransformation,androidx.compose.foundation.ScrollState,androidx.compose.ui.graphics.Shape,androidx.compose.material3.TextFieldColors,androidx.compose.foundation.interaction.MutableInteractionSource)` uses `https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/TextFieldState` to keep track of the text content and position of the cursor or selection, and `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarDefaults#InputField(androidx.compose.foundation.text.input.TextFieldState,kotlin.Function1,kotlin.Boolean,kotlin.Function1,androidx.compose.ui.Modifier,kotlin.Boolean,kotlin.Boolean,androidx.compose.ui.text.TextStyle,kotlin.Function0,kotlin.Function0,kotlin.Function0,kotlin.Function0,kotlin.Function0,androidx.compose.foundation.text.input.InputTransformation,androidx.compose.foundation.text.input.OutputTransformation,androidx.compose.foundation.ScrollState,androidx.compose.ui.graphics.Shape,androidx.compose.material3.TextFieldColors,androidx.compose.foundation.interaction.MutableInteractionSource)` and `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarDefaults#InputField(androidx.compose.foundation.text.input.TextFieldState,kotlin.Function1,kotlin.Boolean,kotlin.Function1,androidx.compose.ui.Modifier,kotlin.Boolean,kotlin.Boolean,androidx.compose.ui.text.TextStyle,kotlin.Function0,kotlin.Function0,kotlin.Function0,kotlin.Function0,kotlin.Function0,androidx.compose.foundation.text.input.InputTransformation,androidx.compose.foundation.text.input.OutputTransformation,androidx.compose.foundation.ScrollState,androidx.compose.ui.graphics.Shape,androidx.compose.material3.TextFieldColors,androidx.compose.foundation.interaction.MutableInteractionSource)` to keep track of the state of the search bar. It should be used with the search bar APIs which also accept `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarDefaults#InputField(androidx.compose.foundation.text.input.TextFieldState,kotlin.Function1,kotlin.Boolean,kotlin.Function1,androidx.compose.ui.Modifier,kotlin.Boolean,kotlin.Boolean,androidx.compose.ui.text.TextStyle,kotlin.Function0,kotlin.Function0,kotlin.Function0,kotlin.Function0,kotlin.Function0,androidx.compose.foundation.text.input.InputTransformation,androidx.compose.foundation.text.input.OutputTransformation,androidx.compose.foundation.ScrollState,androidx.compose.ui.graphics.Shape,androidx.compose.material3.TextFieldColors,androidx.compose.foundation.interaction.MutableInteractionSource)` and `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarDefaults#InputField(androidx.compose.foundation.text.input.TextFieldState,kotlin.Function1,kotlin.Boolean,kotlin.Function1,androidx.compose.ui.Modifier,kotlin.Boolean,kotlin.Boolean,androidx.compose.ui.text.TextStyle,kotlin.Function0,kotlin.Function0,kotlin.Function0,kotlin.Function0,kotlin.Function0,androidx.compose.foundation.text.input.InputTransformation,androidx.compose.foundation.text.input.OutputTransformation,androidx.compose.foundation.ScrollState,androidx.compose.ui.graphics.Shape,androidx.compose.material3.TextFieldColors,androidx.compose.foundation.interaction.MutableInteractionSource)`.

| Parameters |
|---|---|
| `state: https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/TextFieldState` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/TextFieldState` that holds the internal editing state of the input field. |
| `onSearch: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | the callback to be invoked when the input service triggers the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/ImeAction#Search()` action. The current query in the `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarDefaults#InputField(androidx.compose.foundation.text.input.TextFieldState,kotlin.Function1,kotlin.Boolean,kotlin.Function1,androidx.compose.ui.Modifier,kotlin.Boolean,kotlin.Boolean,androidx.compose.ui.text.TextStyle,kotlin.Function0,kotlin.Function0,kotlin.Function0,kotlin.Function0,kotlin.Function0,androidx.compose.foundation.text.input.InputTransformation,androidx.compose.foundation.text.input.OutputTransformation,androidx.compose.foundation.ScrollState,androidx.compose.ui.graphics.Shape,androidx.compose.material3.TextFieldColors,androidx.compose.foundation.interaction.MutableInteractionSource)` comes as a parameter of the callback. |
| `expanded: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | whether the search bar is expanded and showing search results. |
| `onExpandedChange: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | the callback to be invoked when the search bar's expanded state is changed. |
| `modifier: https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier = Modifier` | the `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier` to be applied to this input field. |
| `enabled: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html = true` | the enabled state of this input field. When `false`, this component will not respond to user input, and it will appear visually disabled and disabled to accessibility services. |
| `readOnly: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html = false` | controls the editable state of the input field. When `true`, the field cannot be modified. However, a user can focus it and copy text from it. |
| `textStyle: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle = LocalTextStyle.current` | the style to be applied to the input text. Defaults to `https://developer.android.com/reference/kotlin/androidx/compose/material3/package-summary#LocalTextStyle()`. |
| `placeholder: (@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)? = null` | the placeholder to be displayed when the input text is empty. |
| `leadingIcon: (@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)? = null` | the leading icon to be displayed at the start of the input field. |
| `trailingIcon: (@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)? = null` | the trailing icon to be displayed at the end of the input field. |
| `prefix: (@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)? = null` | the optional prefix to be displayed before the input text. |
| `suffix: (@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)? = null` | the optional suffix to be displayed after the input text. |
| `inputTransformation: https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/InputTransformation? = null` | optional `https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/InputTransformation` that will be used to transform changes to the `https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/TextFieldState` made by the user. The transformation will be applied to changes made by hardware and software keyboard events, pasting or dropping text, accessibility services, and tests. The transformation will *not* be applied when changing the `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarDefaults#InputField(androidx.compose.foundation.text.input.TextFieldState,kotlin.Function1,kotlin.Boolean,kotlin.Function1,androidx.compose.ui.Modifier,kotlin.Boolean,kotlin.Boolean,androidx.compose.ui.text.TextStyle,kotlin.Function0,kotlin.Function0,kotlin.Function0,kotlin.Function0,kotlin.Function0,androidx.compose.foundation.text.input.InputTransformation,androidx.compose.foundation.text.input.OutputTransformation,androidx.compose.foundation.ScrollState,androidx.compose.ui.graphics.Shape,androidx.compose.material3.TextFieldColors,androidx.compose.foundation.interaction.MutableInteractionSource)` programmatically, or when the transformation is changed. If the transformation is changed on an existing text field, it will be applied to the next user edit. The transformation will not immediately affect the current `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarDefaults#InputField(androidx.compose.foundation.text.input.TextFieldState,kotlin.Function1,kotlin.Boolean,kotlin.Function1,androidx.compose.ui.Modifier,kotlin.Boolean,kotlin.Boolean,androidx.compose.ui.text.TextStyle,kotlin.Function0,kotlin.Function0,kotlin.Function0,kotlin.Function0,kotlin.Function0,androidx.compose.foundation.text.input.InputTransformation,androidx.compose.foundation.text.input.OutputTransformation,androidx.compose.foundation.ScrollState,androidx.compose.ui.graphics.Shape,androidx.compose.material3.TextFieldColors,androidx.compose.foundation.interaction.MutableInteractionSource)`. |
| `outputTransformation: https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/OutputTransformation? = null` | optional `https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/OutputTransformation` that transforms how the contents of the text field are presented. |
| `scrollState: https://developer.android.com/reference/kotlin/androidx/compose/foundation/ScrollState = rememberScrollState()` | scroll state that manages the horizontal scroll of the input field. |
| `shape: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Shape = inputFieldShape` | the shape of the input field. |
| `colors: https://developer.android.com/reference/kotlin/androidx/compose/material3/TextFieldColors = inputFieldColors()` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/TextFieldColors` that will be used to resolve the colors used for this input field in different states. See `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarDefaults#inputFieldColors(androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.foundation.text.selection.TextSelectionColors,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color)`. |
| `interactionSource: https://developer.android.com/reference/kotlin/androidx/compose/foundation/interaction/MutableInteractionSource? = null` | an optional hoisted `https://developer.android.com/reference/kotlin/androidx/compose/foundation/interaction/MutableInteractionSource` for observing and emitting `https://developer.android.com/reference/kotlin/androidx/compose/foundation/interaction/Interaction`s for this input field. You can use this to change the search bar's appearance or preview the search bar in different states. Note that if `null` is provided, interactions will still happen internally. |

### InputField

Cmn

```
@Composable
fun InputField(
    textFieldState: TextFieldState,
    searchBarState: SearchBarState,
    onSearch: (String) -> Unit,
    modifier: Modifier = Modifier,
    enabled: Boolean = true,
    readOnly: Boolean = false,
    textStyle: TextStyle = LocalTextStyle.current,
    placeholder: (@Composable () -> Unit)? = null,
    leadingIcon: (@Composable () -> Unit)? = null,
    trailingIcon: (@Composable () -> Unit)? = null,
    prefix: (@Composable () -> Unit)? = null,
    suffix: (@Composable () -> Unit)? = null,
    inputTransformation: InputTransformation? = null,
    outputTransformation: OutputTransformation? = null,
    scrollState: ScrollState = rememberScrollState(),
    shape: Shape = inputFieldShape,
    colors: TextFieldColors = inputFieldColors(),
    interactionSource: MutableInteractionSource? = null,
    keyboardOptions: KeyboardOptions = KeyboardOptions.Default,
    lineLimits: TextFieldLineLimits = TextFieldLineLimits.SingleLine
): Unit
```

A text field to input a query in a search bar.

This overload of `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarDefaults#InputField(androidx.compose.foundation.text.input.TextFieldState,androidx.compose.material3.SearchBarState,kotlin.Function1,androidx.compose.ui.Modifier,kotlin.Boolean,kotlin.Boolean,androidx.compose.ui.text.TextStyle,kotlin.Function0,kotlin.Function0,kotlin.Function0,kotlin.Function0,kotlin.Function0,androidx.compose.foundation.text.input.InputTransformation,androidx.compose.foundation.text.input.OutputTransformation,androidx.compose.foundation.ScrollState,androidx.compose.ui.graphics.Shape,androidx.compose.material3.TextFieldColors,androidx.compose.foundation.interaction.MutableInteractionSource,androidx.compose.foundation.text.KeyboardOptions,androidx.compose.foundation.text.input.TextFieldLineLimits)` uses `https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/TextFieldState` to keep track of the text content and position of the cursor or selection, and `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarState` to keep track of the state of the search bar. It should be used with the search bar APIs which also accept a `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarState`.

| Parameters |
|---|---|
| `textFieldState: https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/TextFieldState` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/TextFieldState` that holds the internal editing state of the input field. |
| `searchBarState: https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarState` | the state of the search bar as a whole. |
| `onSearch: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | the callback to be invoked when the input service triggers the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/ImeAction#Search()` action. The current query in the `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarDefaults#InputField(androidx.compose.foundation.text.input.TextFieldState,androidx.compose.material3.SearchBarState,kotlin.Function1,androidx.compose.ui.Modifier,kotlin.Boolean,kotlin.Boolean,androidx.compose.ui.text.TextStyle,kotlin.Function0,kotlin.Function0,kotlin.Function0,kotlin.Function0,kotlin.Function0,androidx.compose.foundation.text.input.InputTransformation,androidx.compose.foundation.text.input.OutputTransformation,androidx.compose.foundation.ScrollState,androidx.compose.ui.graphics.Shape,androidx.compose.material3.TextFieldColors,androidx.compose.foundation.interaction.MutableInteractionSource,androidx.compose.foundation.text.KeyboardOptions,androidx.compose.foundation.text.input.TextFieldLineLimits)` comes as a parameter of the callback. |
| `modifier: https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier = Modifier` | the `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier` to be applied to this input field. |
| `enabled: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html = true` | the enabled state of this input field. When `false`, this component will not respond to user input, and it will appear visually disabled and disabled to accessibility services. |
| `readOnly: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html = false` | controls the editable state of the input field. When `true`, the field cannot be modified. However, a user can focus it and copy text from it. |
| `textStyle: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle = LocalTextStyle.current` | the style to be applied to the input text. Defaults to `https://developer.android.com/reference/kotlin/androidx/compose/material3/package-summary#LocalTextStyle()`. |
| `placeholder: (@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)? = null` | the placeholder to be displayed when the input text is empty. |
| `leadingIcon: (@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)? = null` | the leading icon to be displayed at the start of the input field. |
| `trailingIcon: (@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)? = null` | the trailing icon to be displayed at the end of the input field. |
| `prefix: (@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)? = null` | the optional prefix to be displayed before the input text. |
| `suffix: (@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)? = null` | the optional suffix to be displayed after the input text. |
| `inputTransformation: https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/InputTransformation? = null` | optional `https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/InputTransformation` that will be used to transform changes to the `https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/TextFieldState` made by the user. The transformation will be applied to changes made by hardware and software keyboard events, pasting or dropping text, accessibility services, and tests. The transformation will *not* be applied when changing the `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarDefaults#InputField(androidx.compose.foundation.text.input.TextFieldState,androidx.compose.material3.SearchBarState,kotlin.Function1,androidx.compose.ui.Modifier,kotlin.Boolean,kotlin.Boolean,androidx.compose.ui.text.TextStyle,kotlin.Function0,kotlin.Function0,kotlin.Function0,kotlin.Function0,kotlin.Function0,androidx.compose.foundation.text.input.InputTransformation,androidx.compose.foundation.text.input.OutputTransformation,androidx.compose.foundation.ScrollState,androidx.compose.ui.graphics.Shape,androidx.compose.material3.TextFieldColors,androidx.compose.foundation.interaction.MutableInteractionSource,androidx.compose.foundation.text.KeyboardOptions,androidx.compose.foundation.text.input.TextFieldLineLimits)` programmatically, or when the transformation is changed. If the transformation is changed on an existing text field, it will be applied to the next user edit. The transformation will not immediately affect the current `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarDefaults#InputField(androidx.compose.foundation.text.input.TextFieldState,androidx.compose.material3.SearchBarState,kotlin.Function1,androidx.compose.ui.Modifier,kotlin.Boolean,kotlin.Boolean,androidx.compose.ui.text.TextStyle,kotlin.Function0,kotlin.Function0,kotlin.Function0,kotlin.Function0,kotlin.Function0,androidx.compose.foundation.text.input.InputTransformation,androidx.compose.foundation.text.input.OutputTransformation,androidx.compose.foundation.ScrollState,androidx.compose.ui.graphics.Shape,androidx.compose.material3.TextFieldColors,androidx.compose.foundation.interaction.MutableInteractionSource,androidx.compose.foundation.text.KeyboardOptions,androidx.compose.foundation.text.input.TextFieldLineLimits)`. |
| `outputTransformation: https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/OutputTransformation? = null` | optional `https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/OutputTransformation` that transforms how the contents of the text field are presented. |
| `scrollState: https://developer.android.com/reference/kotlin/androidx/compose/foundation/ScrollState = rememberScrollState()` | scroll state that manages the horizontal scroll of the input field. |
| `shape: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Shape = inputFieldShape` | the shape of the input field. |
| `colors: https://developer.android.com/reference/kotlin/androidx/compose/material3/TextFieldColors = inputFieldColors()` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/TextFieldColors` that will be used to resolve the colors used for this input field in different states. See `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarDefaults#inputFieldColors(androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.foundation.text.selection.TextSelectionColors,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color)`. |
| `interactionSource: https://developer.android.com/reference/kotlin/androidx/compose/foundation/interaction/MutableInteractionSource? = null` | an optional hoisted `https://developer.android.com/reference/kotlin/androidx/compose/foundation/interaction/MutableInteractionSource` for observing and emitting `https://developer.android.com/reference/kotlin/androidx/compose/foundation/interaction/Interaction`s for this input field. You can use this to change the search bar's appearance or preview the search bar in different states. Note that if `null` is provided, interactions will still happen internally. |
| `keyboardOptions: https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/KeyboardOptions = KeyboardOptions.Default` | software keyboard options that contains configuration such as `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/KeyboardType`. Note that the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/ImeAction` will always be overwritten with `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/input/ImeAction#Search()`. |
| `lineLimits: https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/TextFieldLineLimits = TextFieldLineLimits.SingleLine` | whether the text field should be `https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/TextFieldLineLimits.SingleLine`, scroll horizontally, and ignore newlines; or `https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/TextFieldLineLimits.MultiLine` and grow and scroll vertically. |

### appBarWithSearchColors

Cmn

```
@ExperimentalMaterial3Api
@Composable
fun appBarWithSearchColors(
    searchBarColors: SearchBarColors = colors(),
    scrolledSearchBarContainerColor: Color = ColorSchemeKeyTokens.SurfaceContainerHighest.value,
    appBarContainerColor: Color = AppBarTokens.ContainerColor.value,
    scrolledAppBarContainerColor: Color = AppBarTokens.OnScrollContainerColor.value,
    appBarNavigationIconColor: Color = AppBarTokens.LeadingIconColor.value,
    appBarActionIconColor: Color = AppBarTokens.TrailingIconColor.value
): AppBarWithSearchColors
```

Creates an `https://developer.android.com/reference/kotlin/androidx/compose/material3/AppBarWithSearchColors` that represents the different colors used in parts of the `https://developer.android.com/reference/kotlin/androidx/compose/material3/AppBarWithSearch.composable#AppBarWithSearch(androidx.compose.material3.SearchBarState,kotlin.Function0,androidx.compose.ui.Modifier,kotlin.Function0,kotlin.Function1,androidx.compose.ui.graphics.Shape,androidx.compose.material3.AppBarWithSearchColors,androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp,androidx.compose.foundation.layout.PaddingValues,androidx.compose.foundation.layout.WindowInsets,androidx.compose.material3.SearchBarScrollBehavior)`.

| Parameters |
|---|---|
| `searchBarColors: https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarColors = colors()` | the search bar colors |
| `scrolledSearchBarContainerColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = ColorSchemeKeyTokens.SurfaceContainerHighest.value` | the container color of the search bar when content is scrolled |
| `appBarContainerColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = AppBarTokens.ContainerColor.value` | the app bar container color |
| `scrolledAppBarContainerColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = AppBarTokens.OnScrollContainerColor.value` | the app bar container color when content is scrolled |
| `appBarNavigationIconColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = AppBarTokens.LeadingIconColor.value` | the color used for the app bar navigation icon |
| `appBarActionIconColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = AppBarTokens.TrailingIconColor.value` | the color used for the app bar action icons |

### colors

Cmn

```
@Composable
fun colors(
    containerColor: Color = SearchBarTokens.ContainerColor.value,
    dividerColor: Color = SearchViewTokens.DividerColor.value,
    inputFieldColors: TextFieldColors = inputFieldColors()
): SearchBarColors
```

Creates a `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarColors` that represents the different colors used in parts of the search bar.

| Parameters |
|---|---|
| `containerColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = SearchBarTokens.ContainerColor.value` | the container color of the search bar |
| `dividerColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = SearchViewTokens.DividerColor.value` | the color of the divider between the input field and the search results |
| `inputFieldColors: https://developer.android.com/reference/kotlin/androidx/compose/material3/TextFieldColors = inputFieldColors()` | the colors of the input field. This can be accessed using `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarColors#inputFieldColors()` and should be passed to the `inputField` slot of the search bar. |

### containedColors

Cmn

```
@Composable
fun containedColors(state: SearchBarState): SearchBarColors
```

Creates a `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarColors` that represents the different colors used in parts of the search bar based on `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarState`.

This should be used in conjunction with an `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)` and this value's `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarDefaults#inputFieldColors(androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.foundation.text.selection.TextSelectionColors,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color)` passed to the associated `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarDefaults#InputField(androidx.compose.foundation.text.input.TextFieldState,androidx.compose.material3.SearchBarState,kotlin.Function1,androidx.compose.ui.Modifier,kotlin.Boolean,kotlin.Boolean,androidx.compose.ui.text.TextStyle,kotlin.Function0,kotlin.Function0,kotlin.Function0,kotlin.Function0,kotlin.Function0,androidx.compose.foundation.text.input.InputTransformation,androidx.compose.foundation.text.input.OutputTransformation,androidx.compose.foundation.ScrollState,androidx.compose.ui.graphics.Shape,androidx.compose.material3.TextFieldColors,androidx.compose.foundation.interaction.MutableInteractionSource,androidx.compose.foundation.text.KeyboardOptions,androidx.compose.foundation.text.input.TextFieldLineLimits)`.

| Parameters |
|---|---|
| `state: https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarState` | the state of the search bar. |

### enterAlwaysSearchBarScrollBehavior

Cmn

```
@Composable
fun enterAlwaysSearchBarScrollBehavior(
    scrollState: SearchBarScrollState = rememberSearchBarScrollState(),
    canScroll: () -> Boolean = { true },
    snapAnimationSpec: AnimationSpec<Float> = MotionSchemeKeyTokens.DefaultEffects.value(),
    flingAnimationSpec: DecayAnimationSpec<Float> = rememberSplineBasedDecay(),
    reverseLayout: Boolean = false
): SearchBarScrollBehavior
```

Returns a `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarScrollBehavior`. A search bar that is set up with this behavior will immediately scroll upward off-screen when the content is pulled up, and will immediately appear when the content is pulled down.

The returned `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarScrollBehavior` is remembered across compositions.

| Parameters |
|---|---|
| `scrollState: https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarScrollState = rememberSearchBarScrollState()` | the state object to be used to control or observe the search bar's scroll state. See `https://developer.android.com/reference/kotlin/androidx/compose/material3/rememberSearchBarScrollState.composable#rememberSearchBarScrollState(kotlin.Float,kotlin.Float,kotlin.Float)` for a state that is remembered across compositions. |
| `canScroll: () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html = { true }` | a callback used to determine whether scroll events are to be handled by this `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarScrollBehavior`. |
| `snapAnimationSpec: https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationSpec<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html> = MotionSchemeKeyTokens.DefaultEffects.value()` | an `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationSpec` that defines how the search bar's scroll offset snaps to either its limit or 0 when a fling or a drag scrolls it into an intermediate position. |
| `flingAnimationSpec: https://developer.android.com/reference/kotlin/androidx/compose/animation/core/DecayAnimationSpec<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html> = rememberSplineBasedDecay()` | a `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/DecayAnimationSpec` that defines how to fling the search bar when the user flings the search bar itself, or the content beneath it. |
| `reverseLayout: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html = false` | indicates that this behavior is applied to a scrollable content that has a reversed direction of scrolling and layout. |

### enterAlwaysSearchBarScrollBehavior

Cmn

```
@Composable
fun [enterAlwaysSearchBarScrollBehavior](https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarDefaults#enterAlwaysSearchBarScrollBehavior(kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Function0,androidx.compose.animation.core.AnimationSpec,androidx.compose.animation.core.DecayAnimationSpec,kotlin.Boolean))(
    initialOffset: Float = 0.0f,
    initialOffsetLimit: Float = -Float.MAX_VALUE,
    initialContentOffset: Float = 0.0f,
    canScroll: () -> Boolean = { true },
    snapAnimationSpec: AnimationSpec<Float> = MotionSchemeKeyTokens.DefaultEffects.value(),
    flingAnimationSpec: DecayAnimationSpec<Float> = rememberSplineBasedDecay(),
    reverseLayout: Boolean = false
): SearchBarScrollBehavior
```

> [!CAUTION]
> **This function is deprecated.**   
> Use \`enterAlwaysSearchBarScrollBehavior\` that accepts a \`SearchBarScrollState\` parameter, use this instead:
>
> ```kotlin
> enterAlwaysSearchBarScrollBehavior(state, canScroll, snapAnimationSpec, flingAnimationSpec, reverseLayout)
> ```

### inputFieldColors

Cmn

```
@Composable
fun inputFieldColors(
    focusedTextColor: Color = SearchBarTokens.InputTextColor.value,
    unfocusedTextColor: Color = SearchBarTokens.InputTextColor.value,
    disabledTextColor: Color = FilledTextFieldTokens.DisabledInputColor.value.copy(
                alpha = FilledTextFieldTokens.DisabledInputOpacity
            ),
    cursorColor: Color = FilledTextFieldTokens.CaretColor.value,
    selectionColors: TextSelectionColors = LocalTextSelectionColors.current,
    focusedLeadingIconColor: Color = SearchBarTokens.LeadingIconColor.value,
    unfocusedLeadingIconColor: Color = SearchBarTokens.LeadingIconColor.value,
    disabledLeadingIconColor: Color = FilledTextFieldTokens.DisabledLeadingIconColor.value.copy(
                alpha = FilledTextFieldTokens.DisabledLeadingIconOpacity
            ),
    focusedTrailingIconColor: Color = SearchBarTokens.TrailingIconColor.value,
    unfocusedTrailingIconColor: Color = SearchBarTokens.TrailingIconColor.value,
    disabledTrailingIconColor: Color = FilledTextFieldTokens.DisabledTrailingIconColor.value.copy(
                alpha = FilledTextFieldTokens.DisabledTrailingIconOpacity
            ),
    focusedPlaceholderColor: Color = SearchBarTokens.SupportingTextColor.value,
    unfocusedPlaceholderColor: Color = SearchBarTokens.SupportingTextColor.value,
    disabledPlaceholderColor: Color = FilledTextFieldTokens.DisabledInputColor.value.copy(
                alpha = FilledTextFieldTokens.DisabledInputOpacity
            ),
    focusedPrefixColor: Color = FilledTextFieldTokens.InputPrefixColor.value,
    unfocusedPrefixColor: Color = FilledTextFieldTokens.InputPrefixColor.value,
    disabledPrefixColor: Color = FilledTextFieldTokens.InputPrefixColor.value.copy(
                alpha = FilledTextFieldTokens.DisabledInputOpacity
            ),
    focusedSuffixColor: Color = FilledTextFieldTokens.InputSuffixColor.value,
    unfocusedSuffixColor: Color = FilledTextFieldTokens.InputSuffixColor.value,
    disabledSuffixColor: Color = FilledTextFieldTokens.InputSuffixColor.value.copy(
                alpha = FilledTextFieldTokens.DisabledInputOpacity
            ),
    focusedContainerColor: Color = Color.Transparent,
    unfocusedContainerColor: Color = Color.Transparent,
    disabledContainerColor: Color = Color.Transparent
): TextFieldColors
```

Creates a `https://developer.android.com/reference/kotlin/androidx/compose/material3/TextFieldColors` that represents the different colors used in the search bar input field in different states.

Only a subset of the full list of `https://developer.android.com/reference/kotlin/androidx/compose/material3/TextFieldColors` parameters are used in the input field. All other parameters have no effect.

| Parameters |
|---|---|
| `focusedTextColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = SearchBarTokens.InputTextColor.value` | the color used for the input text of this input field when focused |
| `unfocusedTextColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = SearchBarTokens.InputTextColor.value` | the color used for the input text of this input field when not focused |
| `disabledTextColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = FilledTextFieldTokens.DisabledInputColor.value.copy( alpha = FilledTextFieldTokens.DisabledInputOpacity )` | the color used for the input text of this input field when disabled |
| `cursorColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = FilledTextFieldTokens.CaretColor.value` | the cursor color for this input field |
| `selectionColors: https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/selection/TextSelectionColors = LocalTextSelectionColors.current` | the colors used when the input text of this input field is selected |
| `focusedLeadingIconColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = SearchBarTokens.LeadingIconColor.value` | the leading icon color for this input field when focused |
| `unfocusedLeadingIconColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = SearchBarTokens.LeadingIconColor.value` | the leading icon color for this input field when not focused |
| `disabledLeadingIconColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = FilledTextFieldTokens.DisabledLeadingIconColor.value.copy( alpha = FilledTextFieldTokens.DisabledLeadingIconOpacity )` | the leading icon color for this input field when disabled |
| `focusedTrailingIconColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = SearchBarTokens.TrailingIconColor.value` | the trailing icon color for this input field when focused |
| `unfocusedTrailingIconColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = SearchBarTokens.TrailingIconColor.value` | the trailing icon color for this input field when not focused |
| `disabledTrailingIconColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = FilledTextFieldTokens.DisabledTrailingIconColor.value.copy( alpha = FilledTextFieldTokens.DisabledTrailingIconOpacity )` | the trailing icon color for this input field when disabled |
| `focusedPlaceholderColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = SearchBarTokens.SupportingTextColor.value` | the placeholder color for this input field when focused |
| `unfocusedPlaceholderColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = SearchBarTokens.SupportingTextColor.value` | the placeholder color for this input field when not focused |
| `disabledPlaceholderColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = FilledTextFieldTokens.DisabledInputColor.value.copy( alpha = FilledTextFieldTokens.DisabledInputOpacity )` | the placeholder color for this input field when disabled |
| `focusedPrefixColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = FilledTextFieldTokens.InputPrefixColor.value` | the prefix color for this input field when focused |
| `unfocusedPrefixColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = FilledTextFieldTokens.InputPrefixColor.value` | the prefix color for this input field when not focused |
| `disabledPrefixColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = FilledTextFieldTokens.InputPrefixColor.value.copy( alpha = FilledTextFieldTokens.DisabledInputOpacity )` | the prefix color for this input field when disabled |
| `focusedSuffixColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = FilledTextFieldTokens.InputSuffixColor.value` | the suffix color for this input field when focused |
| `unfocusedSuffixColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = FilledTextFieldTokens.InputSuffixColor.value` | the suffix color for this input field when not focused |
| `disabledSuffixColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = FilledTextFieldTokens.InputSuffixColor.value.copy( alpha = FilledTextFieldTokens.DisabledInputOpacity )` | the suffix color for this input field when disabled |
| `focusedContainerColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = Color.Transparent` | the container color for this input field when focused |
| `unfocusedContainerColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = Color.Transparent` | the container color for this input field when not focused |
| `disabledContainerColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = Color.Transparent` | the container color for this input field when disabled |

## Public properties

### AppBarContentPadding

Cmn

```
val AppBarContentPadding: PaddingValues
```

Default padding used for `https://developer.android.com/reference/kotlin/androidx/compose/material3/AppBarWithSearch.composable#AppBarWithSearch(androidx.compose.material3.SearchBarState,kotlin.Function0,androidx.compose.ui.Modifier,kotlin.Function0,kotlin.Function1,androidx.compose.ui.graphics.Shape,androidx.compose.material3.AppBarWithSearchColors,androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp,androidx.compose.foundation.layout.PaddingValues,androidx.compose.foundation.layout.WindowInsets,androidx.compose.material3.SearchBarScrollBehavior)` content

### Elevation

Cmn

```
val Elevation: Dp
```

> [!CAUTION]
> **This property is deprecated.**   
> Renamed to TonalElevation. Not to be confused with ShadowElevation, use this instead:
>
> ```kotlin
> TonalElevation
> ```

### InputFieldHeight

Cmn

```
val InputFieldHeight: Dp
```

Default height for a search bar's input field, or a search bar in the unexpanded state.

### ShadowElevation

Cmn

```
val ShadowElevation: Dp
```

Default shadow elevation for a search bar.

### TonalElevation

Cmn

```
val TonalElevation: Dp
```

Default tonal elevation for a search bar.

### collapsedContainedSearchBarColor

Cmn

```
val collapsedContainedSearchBarColor: Color
```

Default container color for an `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)` in the collapsed state.

### dockedDropdownGapSize

Cmn

```
val dockedDropdownGapSize: Dp
```

Default gap size for a drop-down attached to a `https://developer.android.com/reference/kotlin/androidx/compose/material3/DockedSearchBar.composable#DockedSearchBar(kotlin.Function0,kotlin.Boolean,kotlin.Function1,androidx.compose.ui.Modifier,androidx.compose.ui.graphics.Shape,androidx.compose.material3.SearchBarColors,androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp,kotlin.Function1)`.

### dockedDropdownScrimColor

Cmn

```
val dockedDropdownScrimColor: Color
```

Default scrim color for a drop-down attached to a `https://developer.android.com/reference/kotlin/androidx/compose/material3/DockedSearchBar.composable#DockedSearchBar(kotlin.Function0,kotlin.Boolean,kotlin.Function1,androidx.compose.ui.Modifier,androidx.compose.ui.graphics.Shape,androidx.compose.material3.SearchBarColors,androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp,kotlin.Function1)`.

### dockedDropdownShape

Cmn

```
val dockedDropdownShape: Shape
```

Default shape for a drop-down containing search results attached to a `https://developer.android.com/reference/kotlin/androidx/compose/material3/DockedSearchBar.composable#DockedSearchBar(kotlin.Function0,kotlin.Boolean,kotlin.Function1,androidx.compose.ui.Modifier,androidx.compose.ui.graphics.Shape,androidx.compose.material3.SearchBarColors,androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp,kotlin.Function1)`.

### dockedShape

Cmn

```
val dockedShape: Shape
```

Default shape for a `https://developer.android.com/reference/kotlin/androidx/compose/material3/DockedSearchBar.composable#DockedSearchBar(kotlin.Function0,kotlin.Boolean,kotlin.Function1,androidx.compose.ui.Modifier,androidx.compose.ui.graphics.Shape,androidx.compose.material3.SearchBarColors,androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp,kotlin.Function1)`.

### fullScreenContainedSearchBarColor

Cmn

```
val fullScreenContainedSearchBarColor: Color
```

Default container color for an `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)` in the expanded state.

### fullScreenShape

Cmn

```
val fullScreenShape: Shape
```

Default shape for a `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBar.composable#SearchBar(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)` in the expanded state.

### fullScreenWindowInsets

Cmn

```
val fullScreenWindowInsets: WindowInsets
```

Default window insets used and consumed by `https://developer.android.com/reference/kotlin/androidx/compose/material3/ExpandedFullScreenSearchBar.composable#ExpandedFullScreenSearchBar(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)`.

### inputFieldShape

Cmn

```
val inputFieldShape: Shape
```

Default shape for a search bar's input field, or a search bar in the unexpanded state.

### windowInsets

Cmn

```
val windowInsets: WindowInsets
```

Default window insets for an `https://developer.android.com/reference/kotlin/androidx/compose/material3/AppBarWithSearch.composable#AppBarWithSearch(androidx.compose.material3.SearchBarState,kotlin.Function0,androidx.compose.ui.Modifier,kotlin.Function0,kotlin.Function1,androidx.compose.ui.graphics.Shape,androidx.compose.material3.AppBarWithSearchColors,androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp,androidx.compose.foundation.layout.PaddingValues,androidx.compose.foundation.layout.WindowInsets,androidx.compose.material3.SearchBarScrollBehavior)`.