# BottomDrawerState

Artifact: [androidx.compose.material:material](https://developer.android.com/jetpack/androidx/releases/compose-material) [View Source](https://cs.android.com/search?q=file:androidx/compose/material/Drawer.kt+class:androidx.compose.material.BottomDrawerState) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-material#1.0.0) Common/AllAndroid/JVM
- Cmn

  ```
  class BottomDrawerState
  ```

*** ** * ** ***

State of the `https://developer.android.com/reference/kotlin/androidx/compose/material/BottomDrawer.composable#BottomDrawer(kotlin.Function1,androidx.compose.ui.Modifier,androidx.compose.material.BottomDrawerState,kotlin.Boolean,androidx.compose.ui.graphics.Shape,androidx.compose.ui.unit.Dp,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,kotlin.Function0)` composable.

## Summary

| ### Public companion functions |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/runtime/saveable/Saver<https://developer.android.com/reference/kotlin/androidx/compose/material/BottomDrawerState, https://developer.android.com/reference/kotlin/androidx/compose/material/BottomDrawerValue>` | `https://developer.android.com/reference/kotlin/androidx/compose/material/BottomDrawerState#Saver(androidx.compose.ui.unit.Density,kotlin.Function1,androidx.compose.animation.core.AnimationSpec)( density: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density, confirmStateChange: (https://developer.android.com/reference/kotlin/androidx/compose/material/BottomDrawerValue) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, animationSpec: https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationSpec<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html> )` The default `https://developer.android.com/reference/kotlin/androidx/compose/material/BottomDrawerState#Saver(androidx.compose.ui.unit.Density,kotlin.Function1,androidx.compose.animation.core.AnimationSpec)` implementation for `https://developer.android.com/reference/kotlin/androidx/compose/material/BottomDrawerState`. | Cmn |

| ### Public constructors |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/material/BottomDrawerState#BottomDrawerState(androidx.compose.material.BottomDrawerValue,androidx.compose.ui.unit.Density,kotlin.Function1,androidx.compose.animation.core.AnimationSpec)( initialValue: https://developer.android.com/reference/kotlin/androidx/compose/material/BottomDrawerValue, density: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density, confirmStateChange: (https://developer.android.com/reference/kotlin/androidx/compose/material/BottomDrawerValue) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, animationSpec: https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationSpec<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html> )` | Cmn |

| ### Public functions |
|---|---|---|
| `suspend https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/material/BottomDrawerState#close()()` Close the drawer with animation and suspend until it if fully closed or animation has been cancelled. | Cmn |
| `suspend https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/material/BottomDrawerState#expand()()` Expand the drawer with animation and suspend until it if fully expanded or animation has been cancelled. | Cmn |
| `suspend https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/material/BottomDrawerState#open()()` Open the drawer with animation and suspend until it if fully opened or animation has been cancelled. | Cmn |
| `@https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0, to = 1.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/material/BottomDrawerState#progress(androidx.compose.material.BottomDrawerValue,androidx.compose.material.BottomDrawerValue)(from: https://developer.android.com/reference/kotlin/androidx/compose/material/BottomDrawerValue, to: https://developer.android.com/reference/kotlin/androidx/compose/material/BottomDrawerValue)` The fraction of the offset between `https://developer.android.com/reference/kotlin/androidx/compose/material/BottomDrawerState#progress(androidx.compose.material.BottomDrawerValue,androidx.compose.material.BottomDrawerValue)` and `https://developer.android.com/reference/kotlin/androidx/compose/material/BottomDrawerState#progress(androidx.compose.material.BottomDrawerValue,androidx.compose.material.BottomDrawerValue)`, as a fraction between 0f..1f, or 1f if `https://developer.android.com/reference/kotlin/androidx/compose/material/BottomDrawerState#progress(androidx.compose.material.BottomDrawerValue,androidx.compose.material.BottomDrawerValue)` is equal to `https://developer.android.com/reference/kotlin/androidx/compose/material/BottomDrawerState#progress(androidx.compose.material.BottomDrawerValue,androidx.compose.material.BottomDrawerValue)`. | Cmn |

| ### Public properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/material/BottomDrawerValue` | `https://developer.android.com/reference/kotlin/androidx/compose/material/BottomDrawerState#currentValue()` The current value of the `https://developer.android.com/reference/kotlin/androidx/compose/material/BottomDrawerState`. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/material/BottomDrawerState#isClosed()` Whether the drawer is closed. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/material/BottomDrawerState#isExpanded()` Whether the drawer is expanded. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/material/BottomDrawerState#isOpen()` Whether the drawer is open, either in opened or expanded state. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/material/BottomDrawerState#offset()` The current offset in pixels, or `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/-companion/-na-n.html` if it has not been initialized yet. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `@https://developer.android.com/reference/kotlin/androidx/compose/material/ExperimentalMaterialApi https://developer.android.com/reference/kotlin/androidx/compose/material/BottomDrawerState#progress()` **This property is deprecated.** Please use the progress function to query progress explicitly between targets. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/material/BottomDrawerValue` | `https://developer.android.com/reference/kotlin/androidx/compose/material/BottomDrawerState#targetValue()` The target value the state will settle at once the current interaction ends, or the `https://developer.android.com/reference/kotlin/androidx/compose/material/BottomDrawerState#currentValue()` if there is no interaction in progress. | Cmn |

## Public companion functions

### Saver

Cmn Added in [1.7.0](https://developer.android.com/jetpack/androidx/releases/compose-material#1.7.0)

```
fun Saver(
    density: Density,
    confirmStateChange: (BottomDrawerValue) -> Boolean,
    animationSpec: AnimationSpec<Float>
): Saver<BottomDrawerState, BottomDrawerValue>
```

The default `https://developer.android.com/reference/kotlin/androidx/compose/material/BottomDrawerState#Saver(androidx.compose.ui.unit.Density,kotlin.Function1,androidx.compose.animation.core.AnimationSpec)` implementation for `https://developer.android.com/reference/kotlin/androidx/compose/material/BottomDrawerState`.

## Public constructors

### BottomDrawerState

Cmn Added in [1.7.0](https://developer.android.com/jetpack/androidx/releases/compose-material#1.7.0)

```
BottomDrawerState(
    initialValue: BottomDrawerValue,
    density: Density,
    confirmStateChange: (BottomDrawerValue) -> Boolean = { true },
    animationSpec: AnimationSpec<Float> = DrawerDefaults.AnimationSpec
)
```

| Parameters |
|---|---|
| `initialValue: https://developer.android.com/reference/kotlin/androidx/compose/material/BottomDrawerValue` | The initial value of the state. |
| `density: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density` | The density that this state can use to convert values to and from dp. |
| `confirmStateChange: (https://developer.android.com/reference/kotlin/androidx/compose/material/BottomDrawerValue) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html = { true }` | Optional callback invoked to confirm or veto a pending state change. |
| `animationSpec: https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationSpec<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html> = DrawerDefaults.AnimationSpec` | The animation spec to be used for open/close animations, as well as settling when a user lets go. |

## Public functions

### close

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-material#1.0.0)

```
suspend fun close(): Unit
```

Close the drawer with animation and suspend until it if fully closed or animation has been cancelled.

| Throws |
|---|---|
| `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-cancellation-exception/index.html` | if the animation is interrupted |

### expand

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-material#1.0.0)

```
suspend fun expand(): Unit
```

Expand the drawer with animation and suspend until it if fully expanded or animation has been cancelled.

| Throws |
|---|---|
| `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-cancellation-exception/index.html` | if the animation is interrupted |

### open

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-material#1.0.0)

```
suspend fun open(): Unit
```

Open the drawer with animation and suspend until it if fully opened or animation has been cancelled. If the content height is less than `https://developer.android.com/reference/kotlin/androidx/compose/material/package-summary#BottomDrawerOpenFraction()`, the drawer state will move to `https://developer.android.com/reference/kotlin/androidx/compose/material/BottomDrawerValue#Expanded` instead.

| Throws |
|---|---|
| `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-cancellation-exception/index.html` | if the animation is interrupted |

### progress

Cmn Added in [1.7.0](https://developer.android.com/jetpack/androidx/releases/compose-material#1.7.0)

```
fun progress(from: BottomDrawerValue, to: BottomDrawerValue): @FloatRange(from = 0.0, to = 1.0) Float
```

The fraction of the offset between `https://developer.android.com/reference/kotlin/androidx/compose/material/BottomDrawerState#progress(androidx.compose.material.BottomDrawerValue,androidx.compose.material.BottomDrawerValue)` and `https://developer.android.com/reference/kotlin/androidx/compose/material/BottomDrawerState#progress(androidx.compose.material.BottomDrawerValue,androidx.compose.material.BottomDrawerValue)`, as a fraction between 0f..1f, or 1f if `https://developer.android.com/reference/kotlin/androidx/compose/material/BottomDrawerState#progress(androidx.compose.material.BottomDrawerValue,androidx.compose.material.BottomDrawerValue)` is equal to `https://developer.android.com/reference/kotlin/androidx/compose/material/BottomDrawerState#progress(androidx.compose.material.BottomDrawerValue,androidx.compose.material.BottomDrawerValue)`.

| Parameters |
|---|---|
| `from: https://developer.android.com/reference/kotlin/androidx/compose/material/BottomDrawerValue` | The starting value used to calculate the distance |
| `to: https://developer.android.com/reference/kotlin/androidx/compose/material/BottomDrawerValue` | The end value used to calculate the distance |

## Public properties

### currentValue

Cmn

```
val currentValue: BottomDrawerValue
```

The current value of the `https://developer.android.com/reference/kotlin/androidx/compose/material/BottomDrawerState`.

### isClosed

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-material#1.0.0)

```
val isClosed: Boolean
```

Whether the drawer is closed.

### isExpanded

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-material#1.0.0)

```
val isExpanded: Boolean
```

Whether the drawer is expanded.

### isOpen

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-material#1.0.0)

```
val isOpen: Boolean
```

Whether the drawer is open, either in opened or expanded state.

### offset

Cmn

```
val offset: Float
```

The current offset in pixels, or `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/-companion/-na-n.html` if it has not been initialized yet.

### progress

Cmn

```
@ExperimentalMaterialApi
val progress: Float
```

> [!CAUTION]
> **This property is deprecated.**   
> Please use the progress function to query progress explicitly between targets, use this instead:
>
> ```kotlin
> progress(from = , to = )
> ```

The fraction of the progress, within 0f..1f bounds, or 1f if the `https://developer.android.com/reference/kotlin/androidx/compose/material/AnchoredDraggableState` is in a settled state.

### targetValue

Cmn

```
val targetValue: BottomDrawerValue
```

The target value the state will settle at once the current interaction ends, or the `https://developer.android.com/reference/kotlin/androidx/compose/material/BottomDrawerState#currentValue()` if there is no interaction in progress.