rememberBottomSheetState

Functions summary

SheetState
@Composable
@ExperimentalMaterial3Api
rememberBottomSheetState(
    initialValue: SheetValue,
    enabledValues: Set<SheetValue>,
    confirmValueChange: (SheetValue) -> Boolean
)

Create and remember a SheetState for BottomSheet, ModalBottomSheet, or BottomSheetScaffold.

Cmn

Functions

rememberBottomSheetState

@Composable
@ExperimentalMaterial3Api
fun rememberBottomSheetState(
    initialValue: SheetValue,
    enabledValues: Set<SheetValue> = setOf(Hidden, PartiallyExpanded, Expanded),
    confirmValueChange: (SheetValue) -> Boolean = { true }
): SheetState

Create and remember a SheetState for BottomSheet, ModalBottomSheet, or BottomSheetScaffold.

Parameters
initialValue: SheetValue

The initial value of the state.

enabledValues: Set<SheetValue> = setOf(Hidden, PartiallyExpanded, Expanded)

The set of SheetValues that the bottom sheet can settle in. This is the direct source of truth for available states; if a value is included here, the component will attempt to create an anchor for it.

confirmValueChange: (SheetValue) -> Boolean = { true }

Optional callback invoked to confirm or veto a pending state change.