rememberModalBottomSheetState

Functions summary

SheetState
@Composable
@ExperimentalMaterial3Api
rememberModalBottomSheetState(
    skipPartiallyExpanded: Boolean,
    confirmValueChange: (SheetValue) -> Boolean
)

This function is deprecated. Use rememberBottomSheetState with Hidden initial value

Cmn

Functions

rememberModalBottomSheetState

@Composable
@ExperimentalMaterial3Api
fun rememberModalBottomSheetState(
    skipPartiallyExpanded: Boolean = false,
    confirmValueChange: (SheetValue) -> Boolean = { true }
): SheetState

Create and remember a SheetState for ModalBottomSheet.

This deprecated method preserves the legacy behavior where the partially expanded state is automatically excluded if the sheet height is less than half the screen height. To move away from this behavior, use rememberBottomSheetState.

Parameters
skipPartiallyExpanded: Boolean = false

Whether the partially expanded state, if the sheet is large enough, should be skipped. If true, the sheet will always expand to the Expanded state and move to the Hidden state when hiding the sheet, either programmatically or by user interaction.

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

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