# WideNavigationRailState

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/WideNavigationRailState.kt+class:androidx.compose.material3.WideNavigationRailState) Common/AllAndroid/JVM
- Cmn

  ```
  interface WideNavigationRailState
  ```

*** ** * ** ***

A state object that can be hoisted to observe the wide navigation rail state. It allows for setting to the rail to be collapsed or expanded.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/material3/rememberWideNavigationRailState.composable#rememberWideNavigationRailState(androidx.compose.material3.WideNavigationRailValue)` | to construct the default implementation. |

## Summary

| ### Public functions |
|---|---|---|
| `suspend https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/WideNavigationRailState#collapse()()` Collapse the rail with animation and suspend until it fully collapses. | Cmn |
| `suspend https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/WideNavigationRailState#expand()()` Expand the rail with animation and suspend until it fully expands. | Cmn |
| `suspend https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/WideNavigationRailState#snapTo(androidx.compose.material3.WideNavigationRailValue)(targetValue: https://developer.android.com/reference/kotlin/androidx/compose/material3/WideNavigationRailValue)` Set the state without any animation and suspend until it's set. | Cmn |
| `suspend https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/WideNavigationRailState#toggle()()` Collapse the rail with animation if it's expanded, or expand it if it's collapsed, and suspend until it's set to its new state. | Cmn |

| ### Public properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/material3/WideNavigationRailValue` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/WideNavigationRailState#currentValue()` Whether the rail is currently expanded or not. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/WideNavigationRailState#isAnimating()` Whether the state is currently animating | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/material3/WideNavigationRailValue` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/WideNavigationRailState#targetValue()` Whether the rail is going to be expanded or not. | Cmn |

## Public functions

### collapse

Cmn

```
suspend fun collapse(): Unit
```

Collapse the rail with animation and suspend until it fully collapses.

### expand

Cmn

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

Expand the rail with animation and suspend until it fully expands.

### snapTo

Cmn

```
suspend fun snapTo(targetValue: WideNavigationRailValue): Unit
```

Set the state without any animation and suspend until it's set.

| Parameters |
|---|---|
| `targetValue: https://developer.android.com/reference/kotlin/androidx/compose/material3/WideNavigationRailValue` | the expanded boolean to set to |

### toggle

Cmn

```
suspend fun toggle(): Unit
```

Collapse the rail with animation if it's expanded, or expand it if it's collapsed, and suspend until it's set to its new state.

## Public properties

### currentValue

Cmn

```
val currentValue: WideNavigationRailValue
```

Whether the rail is currently expanded or not.

### isAnimating

Cmn

```
val isAnimating: Boolean
```

Whether the state is currently animating

### targetValue

Cmn

```
val targetValue: WideNavigationRailValue
```

Whether the rail is going to be expanded or not.