---
title: "DismissState"
description: "State of the [SwipeToDismiss] composable."
type: "class"
---

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


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

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


```kotlin
@ExperimentalMaterialApi
class DismissState(
    initialValue: DismissValue,
    confirmStateChange: (DismissValue) -> Boolean = { true },
) : SwipeableState<DismissValue>(initialValue, confirmStateChange = confirmStateChange)
```


State of the `SwipeToDismiss` composable.

#### Parameters

| | |
| --- | --- |
| initialValue | The initial value of the state. |
| confirmStateChange | Optional callback invoked to confirm or veto a pending state change. |



## Properties

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


```kotlin
val dismissDirection: DismissDirection?
```


The direction (if any) in which the composable has been or is being dismissed.

If the composable is settled at the default state, then this will be null. Use this to change
the background of the `SwipeToDismiss` if you want different actions on each side.



## Functions

```kotlin
fun isDismissed(direction: DismissDirection): Boolean
```


Whether the component has been dismissed in the given `direction`.

#### Parameters

| | |
| --- | --- |
| direction | The dismiss direction. |



```kotlin
suspend fun reset() = animateTo(targetValue = Default)
```


Reset the component to the default position with animation and suspend until it if fully
reset or animation has been cancelled. This method will throw `CancellationException` if the
animation is interrupted

#### Returns

| | |
| --- | --- |
|  | the reason the reset animation ended |



```kotlin
suspend fun dismiss(direction: DismissDirection)
```


Dismiss the component in the given `direction`, with an animation and suspend. This method
will throw `CancellationException` if the animation is interrupted

#### Parameters

| | |
| --- | --- |
| direction | The dismiss direction. |



## Companion Object

#### Methods

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


```kotlin
fun Saver(confirmStateChange: (DismissValue) -> Boolean) =
            Saver<DismissState, DismissValue>(
                save = { it.currentValue },
                restore = { DismissState(it, confirmStateChange) },
            )
```


The default `Saver` implementation for `DismissState`.





