---
title: "rememberRevealState"
description: "Create and [remember] a [RevealState]."
type: "composable"
---

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


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

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


> **Deprecated** The SwipeToReveal component from the latest material library should be used instead. This will be removed in a future release of this library.

```kotlin
@ExperimentalWearFoundationApi
@Composable
public fun rememberRevealState(
    initialValue: RevealValue = RevealValue.Covered,
    animationSpec: AnimationSpec<Float> = SwipeToRevealDefaults.AnimationSpec,
    confirmValueChange: (RevealValue) -> Boolean = { true },
    positionalThreshold: (totalDistance: Float) -> Float =
        SwipeToRevealDefaults.PositionalThreshold,
    anchors: Map<RevealValue, Float> = createRevealAnchors(),
): RevealState
```


Create and `remember` a `RevealState`.

#### Parameters

| | |
| --- | --- |
| initialValue | The initial value of the `RevealValue`. |
| animationSpec | The animation which will be applied on the top content. |
| confirmValueChange | Optional callback invoked to confirm or veto a pending state change. |
| positionalThreshold | The positional threshold to be used when calculating the target state while the reveal is in progress and when settling after the revealing ends. This is the distance from the start of a transition. It will be, depending on the direction of the interaction, added or subtracted from/to the origin offset. It should always be a positive value. |
| anchors | A map of `RevealValue` to the fraction where the content can be revealed to reach that value. Each anchor should be between `0..1` which will be adjusted based on total width. |





