# rememberModalBottomSheetState

Common/AllAndroid/JVM

## Functions summary

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/material3/SheetState` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable @https://developer.android.com/reference/kotlin/androidx/compose/material3/ExperimentalMaterial3Api [rememberModalBottomSheetState](https://developer.android.com/reference/kotlin/androidx/compose/material3/rememberModalBottomSheetState.composable#rememberModalBottomSheetState(kotlin.Boolean,kotlin.Function1))( skipPartiallyExpanded: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, confirmValueChange: (https://developer.android.com/reference/kotlin/androidx/compose/material3/SheetValue) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` **This function is deprecated.** Use rememberBottomSheetState with Hidden initial value | Cmn |

## Functions

### rememberModalBottomSheetState

Cmn Artifact: [androidx.compose.material3:material3](https://developer.android.com/jetpack/androidx/releases/compose-material3) [View Source](https://cs.android.com/search?q=file:androidx/compose/material3/ModalBottomSheet.kt+function:rememberModalBottomSheetState)

```
@Composable
@ExperimentalMaterial3Api
fun [rememberModalBottomSheetState](https://developer.android.com/reference/kotlin/androidx/compose/material3/rememberModalBottomSheetState.composable#rememberModalBottomSheetState(kotlin.Boolean,kotlin.Function1))(
    skipPartiallyExpanded: Boolean = false,
    confirmValueChange: (SheetValue) -> Boolean = { true }
): SheetState
```

> [!CAUTION]
> **This function is deprecated.**   
> Use rememberBottomSheetState with Hidden initial value, use this instead:
>
> ```kotlin
> rememberBottomSheetState(initialValue = SheetValue.Hidden, enabledValues = if (skipPartiallyExpanded) setOf(SheetValue.Hidden, SheetValue.Expanded) else setOf(SheetValue.Hidden, SheetValue.PartiallyExpanded, SheetValue.Expanded), confirmValueChange = confirmValueChange)
> ```

Create and `https://developer.android.com/reference/kotlin/androidx/compose/runtime/remember.composable#remember(kotlin.Function0)` a `https://developer.android.com/reference/kotlin/androidx/compose/material3/SheetState` for `https://developer.android.com/reference/kotlin/androidx/compose/material3/ModalBottomSheet.composable#ModalBottomSheet(kotlin.Function0,androidx.compose.ui.Modifier,androidx.compose.material3.SheetState,androidx.compose.ui.unit.Dp,kotlin.Boolean,androidx.compose.ui.graphics.Shape,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.unit.Dp,androidx.compose.ui.graphics.Color,kotlin.Function0,kotlin.Function0,androidx.compose.material3.ModalBottomSheetProperties,kotlin.Function1)`.

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 `https://developer.android.com/reference/kotlin/androidx/compose/material3/rememberBottomSheetState.composable#rememberBottomSheetState(androidx.compose.material3.SheetValue,kotlin.collections.Set,kotlin.Function1)`.

| Parameters |
|---|---|
| `skipPartiallyExpanded: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html = false` | Whether the partially expanded state, if the sheet is large enough, should be skipped. If true, the sheet will always expand to the `https://developer.android.com/reference/kotlin/androidx/compose/material3/SheetValue#Expanded` state and move to the `https://developer.android.com/reference/kotlin/androidx/compose/material3/SheetValue#Hidden` state when hiding the sheet, either programmatically or by user interaction. |
| `confirmValueChange: (https://developer.android.com/reference/kotlin/androidx/compose/material3/SheetValue) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html = { true }` | Optional callback invoked to confirm or veto a pending state change. |