rememberModalBottomSheetState

fun rememberModalBottomSheetState(initialDetent: SheetDetent, detents: List<SheetDetent> = listOf(SheetDetent.Hidden, SheetDetent.FullyExpanded), animationSpec: AnimationSpec<Float> = tween(), velocityThreshold: () -> Dp = { 125.dp }, positionalThreshold: (totalDistance: Dp) -> Dp = { 56.dp }, confirmDetentChange: (SheetDetent) -> Boolean = { true }, decayAnimationSpec: DecayAnimationSpec<Float> = rememberSplineBasedDecay()): ModalBottomSheetState

Creates a ModalBottomSheetState that is remembered across compositions.

Return

A remembered ModalBottomSheetState instance.

Parameters

initialDetent

The initial detent of the sheet.

detents

The list of detents that the sheet can snap to.

animationSpec

The animation spec to use for animating between detents.

velocityThreshold

The velocity threshold for determining whether to snap to the next detent.

positionalThreshold

The positional threshold for determining whether to snap to the next detent.

confirmDetentChange

Callback to confirm whether a detent change should be allowed.

decayAnimationSpec

The animation spec to use for decay animations.