---
title: "TargetedFlingBehavior"
description: "Interface to specify fling behavior with additional information about its animation target."
type: "interface"
---

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


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

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



```kotlin
interface TargetedFlingBehavior : FlingBehavior
```


Interface to specify fling behavior with additional information about its animation target.


## Functions

```kotlin
suspend fun ScrollScope.performFling(
        initialVelocity: Float,
        onRemainingDistanceUpdated: (Float) -> Unit,
    ): Float
```


Perform settling via fling animation with given velocity and suspend until fling has
finished. Use `onRemainingDistanceUpdated` to report the status of the ongoing fling
animation and the remaining amount of scroll offset.

This functions is called with `ScrollScope` to drive the state change of the
`androidx.compose.foundation.gestures.ScrollableState` via `ScrollScope.scrollBy`.

This function must return the correct velocity left after it is finished flinging in order to
guarantee proper nested scroll support.

#### Parameters

| | |
| --- | --- |
| initialVelocity | velocity available for fling in the orientation specified in `androidx.compose.foundation.gestures.scrollable` that invoked this method. |
| onRemainingDistanceUpdated | a lambda that will be called anytime the distance to the settling offset is updated. The settling offset in pixels is passed to this lambda an it represents the final offset where this fling will stop and may change depending on the snapping animation progression. |


#### Returns

| | |
| --- | --- |
|  | remaining velocity after fling operation has ended |



```kotlin
override suspend fun ScrollScope.performFling(initialVelocity: Float): Float
```


