Android 12 Developer Preview is here! Try it out, and give us your feedback!

ModalBottomSheetState

class ModalBottomSheetState : SwipeableState<ModalBottomSheetValue>
kotlin.Any
   ↳ androidx.compose.material.SwipeableState<androidx.compose.material.ModalBottomSheetValue>
   ↳ androidx.compose.material.ModalBottomSheetState

State of the ModalBottomSheetLayout composable.

Summary

Public constructors
<init>(initialValue: ModalBottomSheetValue, animationSpec: AnimationSpec<Float> = SwipeableDefaults.AnimationSpec, confirmStateChange: (ModalBottomSheetValue) -> Boolean = { true })

State of the ModalBottomSheetLayout composable.

Public methods
suspend Unit

Hide the bottom sheet with animation and suspend until it if fully hidden or animation has been cancelled.

suspend Unit

Show the bottom sheet with animation and suspend until it's shown.

Companion functions
Saver<ModalBottomSheetState, *>
Saver(animationSpec: AnimationSpec<Float>, confirmStateChange: (ModalBottomSheetValue) -> Boolean)

The default Saver implementation for ModalBottomSheetState.

Inherited functions
Properties
Boolean

Whether the bottom sheet is visible.

Inherited properties