---
title: "FloatingToolbarScrollBehavior"
description: "A FloatingToolbarScrollBehavior defines how a floating toolbar should behave when the content
under it is scrolled."
type: "interface"
---

<div class='type'>Interface</div>


<a id='references'></a>

<div class='sourceset sourceset-common'>Common</div>



```kotlin
@ExperimentalMaterial3ExpressiveApi
sealed interface FloatingToolbarScrollBehavior : NestedScrollConnection
```


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


## Properties

<div class='sourceset sourceset-common'>Common</div>


```kotlin
val exitDirection: FloatingToolbarExitDirection
```


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



<div class='sourceset sourceset-common'>Common</div>


```kotlin
val state: FloatingToolbarState
```


A `FloatingToolbarState` that is attached to this behavior and is read and updated when
scrolling happens.



<div class='sourceset sourceset-common'>Common</div>


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


An `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.



<div class='sourceset sourceset-common'>Common</div>


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


An `DecayAnimationSpec` that defines how to fling the floating toolbar when the user flings
the toolbar itself, or the content below it.



## Functions

```kotlin
fun Modifier.floatingScrollBehavior(): Modifier
```


A `Modifier` that is attached to this behavior.



