---
title: "SwipeToDismissBoxState"
description: "State for [SwipeToDismissBox]."
type: "class"
---

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


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

<div class='sourceset sourceset-android'>Android</div>


> **Deprecated** SwipeToDismissBoxState has been migrated, please import it from androidx.wear.compose.foundation.

```kotlin
public class SwipeToDismissBoxState(
    animationSpec: AnimationSpec<Float> = SwipeToDismissBoxDefaults.AnimationSpec,
    confirmStateChange: (SwipeToDismissValue) -> Boolean = { true },
)
```


State for `SwipeToDismissBox`.

#### Parameters

| | |
| --- | --- |
| animationSpec | The default animation that will be used to animate to a new state. |
| confirmStateChange | Optional callback invoked to confirm or veto a pending state change. |



## Functions

```kotlin
public suspend fun snapTo(targetValue: SwipeToDismissValue): Unit
```


Set the state without any animation and suspend until it's set

#### Parameters

| | |
| --- | --- |
| targetValue | The new target value to set `currentValue` to. |




