rememberBottomSheetState

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

Creates a BottomSheetState

Return

A remembered BottomSheetState 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.

confirmDetentChange

Callback to confirm whether a detent change should be allowed.

decayAnimationSpec

The animation spec to use for decay animations.

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.