Composable Function

rememberSwipeableState

Create and remember a SwipeableState with the default animation clock.

rememberSwipeableState

Source set: Common
@Composable
@Deprecated(SwipeableDeprecation)
public 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

initialValue The initial value of the state.
animationSpec The default animation that will be used to animate to a new state.
confirmStateChange Optional callback invoked to confirm or veto a pending state change.
Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: