Compose Unstyled 2.0 is out! Check the official announcement blog ->
Composable Function

rememberBottomSheetState

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

rememberBottomSheetState

Source set: Common
@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 The initial value of the state.
enabledValues 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 Optional callback invoked to confirm or veto a pending state change.

Last updated: