rememberSwipeableState

Composable Function

Common

Deprecated SwipeableDeprecation

@Composable
@ExperimentalMaterialApi
fun <T : Any> rememberSwipeableState(
    initialValue: T,
    animationSpec: AnimationSpec<Float> = AnimationSpec,
    confirmStateChange: (newValue: T) -> Boolean = { true },
): SwipeableState<T>

Create and remember a SwipeableState with the default animation clock.

Parameters

initialValueThe initial value of the state.
animationSpecThe default animation that will be used to animate to a new state.
confirmStateChangeOptional callback invoked to confirm or veto a pending state change.