rememberStylishSwipeToDismissBoxState

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

Creates and remembers a SwipeToDismissBoxState for use with StylishSwipeToDismissBox.

This is the Finish-layer wrapper around the Material 3 rememberSwipeToDismissBoxState, exposing the non-deprecated signature (positionalThreshold instead of the legacy confirmValueChange overload) so callers never touch the deprecated M3 API surface. The settle animation uses StylishTheme.animation tokens — com.segnities007.stylishui.tokens.StylishAnimationTokens.durationMedium duration with com.segnities007.stylishui.tokens.StylishAnimationTokens.defaultEasing — so the dismiss motion matches the rest of the Stylish motion language.

Parameters

initialValue

The initial settled value of the state. Defaults to SwipeToDismissBoxValue.Settled.

positionalThreshold

The distance (as a fraction of the total swipe distance) after which the swipe settles into a dismissed or settled target. Defaults to SwipeToDismissBoxDefaults.positionalThreshold (56 dp).

See also