androidx.compose.material3

rememberSwipeToDismissBoxState

Function

No hand-written docs yet.

Create and remember a SwipeToDismissBoxState.

Parameters

@Composable
fun rememberSwipeToDismissBoxState(
    initialValue: SwipeToDismissBoxValue = SwipeToDismissBoxValue.Settled,
    positionalThreshold: (totalDistance: Float) -> Float = SwipeToDismissBoxDefaults.positionalThreshold,
): SwipeToDismissBoxState

initialValue: SwipeToDismissBoxValueOptional

Default: SwipeToDismissBoxValue.Settled

The initial value of the state.

positionalThreshold: (totalDistance: Float) -> FloatOptional

Default: SwipeToDismissBoxDefaults.positionalThreshold

The positional threshold to be used when calculating the target state while a swipe is in progress and when settling after the swipe 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.

Library docs

Create and remember a SwipeToDismissBoxState.