---
title: "rememberSwipeToDismissBoxState"
description: "Create a [SwipeToDismissBoxState] and remember it."
type: "composable"
---

<div class='type'>Composable Function</div>


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

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


```kotlin
@Composable
public fun rememberSwipeToDismissBoxState(
    animationSpec: AnimationSpec<Float> = SWIPE_TO_DISMISS_BOX_ANIMATION_SPEC,
    confirmStateChange: (SwipeToDismissValue) -> Boolean = { true },
): SwipeToDismissBoxState
```


Create a `SwipeToDismissBoxState` and remember it.

#### Parameters

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





