# SearchBarScrollBehavior

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.SearchBarScrollBehavior) Common/AllAndroid/JVM
- Cmn

  ```
  interface SearchBarScrollBehavior
  ```

*** ** * ** ***

A `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarScrollBehavior` defines how a search bar should behave when the content beneath it is scrolled.

| See also |
|---|---|
| `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)` |   |

## Summary

| ### Public properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/nestedscroll/NestedScrollConnection` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarScrollBehavior#nestedScrollConnection()` A `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/nestedscroll/NestedScrollConnection` that should be attached to a `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/nestedscroll/nestedScroll.modifier#(androidx.compose.ui.Modifier).nestedScroll(androidx.compose.ui.input.nestedscroll.NestedScrollConnection,androidx.compose.ui.input.nestedscroll.NestedScrollDispatcher)` in order to keep track of scroll events. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarScrollState` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarScrollBehavior#scrollState()` A `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarScrollState` that is attached to this behavior and is read and updated when scrolling happens. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarScrollBehavior#searchBarScrollBehaviorModifier()` The modifier that adds scrolling behavior to the search bar component. | Cmn |

## Public properties

### nestedScrollConnection

Cmn

```
val nestedScrollConnection: NestedScrollConnection
```

A `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/nestedscroll/NestedScrollConnection` that should be attached to a `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/nestedscroll/nestedScroll.modifier#(androidx.compose.ui.Modifier).nestedScroll(androidx.compose.ui.input.nestedscroll.NestedScrollConnection,androidx.compose.ui.input.nestedscroll.NestedScrollDispatcher)` in order to keep track of scroll events.

### scrollState

Cmn

```
val scrollState: SearchBarScrollState
```

A `https://developer.android.com/reference/kotlin/androidx/compose/material3/SearchBarScrollState` that is attached to this behavior and is read and updated when scrolling happens.

### searchBarScrollBehaviorModifier

Cmn

```
val searchBarScrollBehaviorModifier: Modifier
```

The modifier that adds scrolling behavior to the search bar component. `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)` applies this automatically.