🌈 Create new beautiful Compose Gradients with our new wesite ->
Composable Function

rememberModalBottomSheetState

Create and remember a SheetState for ModalBottomSheet.

rememberModalBottomSheetState

Source set: Common
@Deprecated(
    message = "Use rememberBottomSheetState with Hidden initial value",
    replaceWith =
        ReplaceWith(
            "rememberBottomSheetState(initialValue = SheetValue.Hidden, " +
                "enabledValues = if (skipPartiallyExpanded) setOf(SheetValue.Hidden, SheetValue.Expanded) " +
                "else setOf(SheetValue.Hidden, SheetValue.PartiallyExpanded, SheetValue.Expanded), " +
                "confirmValueChange = confirmValueChange)",
            "androidx.compose.material3.SheetValue",
        ),
)
@Composable
public fun rememberModalBottomSheetState(
    skipPartiallyExpanded: Boolean = false,
    confirmValueChange: (SheetValue) -> Boolean = { true },
): SheetState

Create and remember a SheetState for ModalBottomSheet.

Parameters

skipPartiallyExpanded 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 Optional callback invoked to confirm or veto a pending state change.

Content updated: