rememberSwipeToDismissBoxState

Composable Function

Android
@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

animationSpecThe default animation used to animate to a new state.
confirmStateChangecallback to confirm or veto a pending state change.