# FloatingToolbarScrollBehavior

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

  ```
  sealed interface FloatingToolbarScrollBehavior : NestedScrollConnection
  ```

*** ** * ** ***

A FloatingToolbarScrollBehavior defines how a floating toolbar should behave when the content under it is scrolled.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/material3/FloatingToolbarDefaults#exitAlwaysScrollBehavior(androidx.compose.material3.FloatingToolbarExitDirection,androidx.compose.material3.FloatingToolbarState,androidx.compose.animation.core.AnimationSpec,androidx.compose.animation.core.DecayAnimationSpec)` |   |

## Summary

| ### Public functions |
|---|---|---|
| `open https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier.[floatingScrollBehavior](https://developer.android.com/reference/kotlin/androidx/compose/material3/FloatingToolbarScrollBehavior#(androidx.compose.ui.Modifier).floatingScrollBehavior())()` **This function is deprecated.** Use floatingScrollBehaviorModifier instead. | Cmn |

| ### Public properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/material3/FloatingToolbarExitDirection` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/FloatingToolbarScrollBehavior#exitDirection()` Indicates the direction towards which the floating toolbar exits the screen. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/DecayAnimationSpec<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html>` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/FloatingToolbarScrollBehavior#flingAnimationSpec()` An `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/DecayAnimationSpec` that defines how to fling the floating toolbar when the user flings the toolbar itself, or the content below it. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/FloatingToolbarScrollBehavior#floatingScrollBehaviorModifier()` A `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier` that is attached to this behavior. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationSpec<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html>` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/FloatingToolbarScrollBehavior#snapAnimationSpec()` An `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationSpec` that defines how the floating toolbar snaps to either fully collapsed or fully extended state when a fling or a drag scrolled it into an intermediate position. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/material3/FloatingToolbarState` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/FloatingToolbarScrollBehavior#state()` A `https://developer.android.com/reference/kotlin/androidx/compose/material3/FloatingToolbarState` that is attached to this behavior and is read and updated when scrolling happens. | Cmn |

### Inherited functions

From [androidx.compose.ui.input.nestedscroll.NestedScrollConnection](https://developer.android.com/reference/kotlin/androidx/compose/ui/input/nestedscroll/NestedScrollConnection) `open suspend https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Velocity` `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/nestedscroll/NestedScrollConnection#onPostFling(androidx.compose.ui.unit.Velocity,androidx.compose.ui.unit.Velocity)(consumed: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Velocity, available: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Velocity)`

Post fling event chain.
Cmn `open https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset` `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/nestedscroll/NestedScrollConnection#onPostScroll(androidx.compose.ui.geometry.Offset,androidx.compose.ui.geometry.Offset,androidx.compose.ui.input.nestedscroll.NestedScrollSource)(
consumed: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset,
available: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset,
source: https://developer.android.com/reference/kotlin/androidx/compose/ui/input/nestedscroll/NestedScrollSource
)`

Post scroll event pass.
Cmn `open suspend https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Velocity` `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/nestedscroll/NestedScrollConnection#onPreFling(androidx.compose.ui.unit.Velocity)(available: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Velocity)`

Pre fling event chain.
Cmn `open https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset` `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/nestedscroll/NestedScrollConnection#onPreScroll(androidx.compose.ui.geometry.Offset,androidx.compose.ui.input.nestedscroll.NestedScrollSource)(available: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset, source: https://developer.android.com/reference/kotlin/androidx/compose/ui/input/nestedscroll/NestedScrollSource)`

Pre scroll event chain.
Cmn

## Public functions

### Modifier.floatingScrollBehavior

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/FloatingToolbar.kt+function:floatingScrollBehavior)

```
open fun Modifier.[floatingScrollBehavior](https://developer.android.com/reference/kotlin/androidx/compose/material3/FloatingToolbarScrollBehavior#(androidx.compose.ui.Modifier).floatingScrollBehavior())(): Modifier
```

> [!CAUTION]
> **This function is deprecated.**   
> Use floatingScrollBehaviorModifier instead, use this instead:
>
> ```kotlin
> this.then(floatingScrollBehaviorModifier)
> ```

A `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier` that is attached to this behavior.

## Public properties

### exitDirection

Cmn

```
val exitDirection: FloatingToolbarExitDirection
```

Indicates the direction towards which the floating toolbar exits the screen.

### flingAnimationSpec

Cmn

```
val flingAnimationSpec: DecayAnimationSpec<Float>
```

An `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/DecayAnimationSpec` that defines how to fling the floating toolbar when the user flings the toolbar itself, or the content below it.

### floatingScrollBehaviorModifier

Cmn

```
val floatingScrollBehaviorModifier: Modifier
```

A `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier` that is attached to this behavior.

### snapAnimationSpec

Cmn

```
val snapAnimationSpec: AnimationSpec<Float>
```

An `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationSpec` that defines how the floating toolbar snaps to either fully collapsed or fully extended state when a fling or a drag scrolled it into an intermediate position.

### state

Cmn

```
val state: FloatingToolbarState
```

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