---
title: "settle"
description: "Find the closest anchor and settle at it with the given [animationSpec]."
type: "function"
---
## API Reference

### settle

> Source set: Common

```kotlin
public suspend fun settle(animationSpec: AnimationSpec<Float>)
```

Find the closest anchor and settle at it with the given `animationSpec`.

#### Parameters

| | |
| --- | --- |
| animationSpec | The animation spec that will be used to animate to the closest anchor. |

### settle

> Source set: Common

```kotlin
@Deprecated(SettleWithVelocityDeprecated, level = DeprecationLevel.WARNING)
    public suspend fun settle(velocity: Float): Float
```

Find the closest anchor, taking into account the velocityThreshold and positionalThreshold,
and settle at it with an animation.

If the `velocity` is lower than the velocityThreshold, the closest anchor by distance and
positionalThreshold will be the target. If the `velocity` is higher than the
velocityThreshold, the positionalThreshold will <b>not</b> be considered and the next anchor
in the direction indicated by the sign of the `velocity` will be the target.

Based on the `velocity`, either snapAnimationSpec or decayAnimationSpec will be used to
animate towards the target.

#### Return

The velocity consumed in the animation
