NavigationRailState

class NavigationRailState(initialValue: NavigationRailValue = NavigationRailValue.Collapsed)

A state holder that controls whether a NavigationRail is collapsed or expanded.

Create it with rememberNavigationRailState and pass it to NavigationRail to make the rail expandable. The width and item-layout transitions are driven declaratively by the rail from currentValue, so mutating the state via expand, collapse or toggle is enough to animate.

Parameters

initialValue

The initial NavigationRailValue.

Constructors

Link copied to clipboard
constructor(initialValue: NavigationRailValue = NavigationRailValue.Collapsed)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The current expansion value.

Link copied to clipboard

Whether the rail is currently expanded.

Functions

Link copied to clipboard
fun collapse()

Collapses the rail.

Link copied to clipboard
fun expand()

Expands the rail.

Link copied to clipboard
fun toggle()

Toggles the rail between collapsed and expanded.