NavigationRail

fun NavigationRail(modifier: Modifier = Modifier, expanded: Boolean = false, header: @Composable ColumnScope.() -> Unit? = null, color: Color = MiuixTheme.colorScheme.surface, showDivider: Boolean = true, defaultWindowInsetsPadding: Boolean = true, minWidth: Dp = NavigationRailDefaults.MinWidth, expandedWidth: Dp = NavigationRailDefaults.ExpandedWidth, scrollState: ScrollState = rememberScrollState(), content: @Composable ColumnScope.() -> Unit)

A non-expandable NavigationRail for wide screens.

Parameters

modifier

The modifier to be applied to the NavigationRail.

expanded

Whether the rail uses its expanded layout.

header

The header of the NavigationRail, usually a FloatingActionButton or a logo.

color

The color of the NavigationRail.

showDivider

Whether to show the divider line between the NavigationRail and the content.

defaultWindowInsetsPadding

whether to apply default window insets padding to the NavigationRail.

minWidth

The minimum width of the NavigationRail, used for the collapsed state.

expandedWidth

The width of the NavigationRail when expanded is true.

scrollState

The ScrollState of the rail's scrollable content column.

content

The content of the NavigationRail, usually NavigationRailItems.


fun NavigationRail(state: NavigationRailState, modifier: Modifier = Modifier, header: @Composable ColumnScope.() -> Unit? = null, color: Color = MiuixTheme.colorScheme.surface, showDivider: Boolean = true, defaultWindowInsetsPadding: Boolean = true, minWidth: Dp = NavigationRailDefaults.MinWidth, expandedWidth: Dp = NavigationRailDefaults.ExpandedWidth, expandContentDescription: String = NavigationRailDefaults.ExpandContentDescription, collapseContentDescription: String = NavigationRailDefaults.CollapseContentDescription, scrollState: ScrollState = rememberScrollState(), content: @Composable ColumnScope.() -> Unit)

An expandable NavigationRail for wide screens.

The rail shows a built-in toggle and animates between minWidth and expandedWidth according to state.

Parameters

modifier

The modifier to be applied to the NavigationRail.

state

Controls the expanded/collapsed state.

header

The header of the NavigationRail, usually a FloatingActionButton or a logo.

color

The color of the NavigationRail.

showDivider

Whether to show the divider line between the NavigationRail and the content.

defaultWindowInsetsPadding

whether to apply default window insets padding to the NavigationRail.

minWidth

The minimum width of the NavigationRail, used for the collapsed state.

expandedWidth

The width of the NavigationRail when expanded.

expandContentDescription

The accessible description of the built-in toggle while the rail is collapsed; override it to localize the announcement.

collapseContentDescription

The accessible description of the built-in toggle while the rail is expanded; override it to localize the announcement.

scrollState

The ScrollState of the rail's scrollable content column.

content

The content of the NavigationRail, usually NavigationRailItems.