---
title: "rememberModalBottomSheetState"
description: "Create a [ModalBottomSheetState] and [remember] it."
type: "composable"
---

<div class='type'>Composable Function</div>


<a id='references'></a>

<div class='sourceset sourceset-common'>Common</div>


```kotlin
@Composable
fun rememberModalBottomSheetState(
    initialValue: ModalBottomSheetValue,
    animationSpec: AnimationSpec<Float> = ModalBottomSheetDefaults.AnimationSpec,
    confirmValueChange: (ModalBottomSheetValue) -> Boolean = { true },
    skipHalfExpanded: Boolean = false,
): ModalBottomSheetState
```


Create a `ModalBottomSheetState` and `remember` it.

#### Parameters

| | |
| --- | --- |
| initialValue | The initial value of the state. |
| animationSpec | The default animation that will be used to animate to a new state. |
| confirmValueChange | Optional callback invoked to confirm or veto a pending state change. |
| skipHalfExpanded | Whether the half expanded state, if the sheet is tall 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. <b>Must not be set to true if the `initialValue` is `ModalBottomSheetValue.HalfExpanded`.</b> If supplied with `ModalBottomSheetValue.HalfExpanded` for the `initialValue`, an `IllegalArgumentException` will be thrown. |





