Modal navigation rail

A rail that expands over the content as a modal panel and collapses back to icons.

When to use

Use the modal rail on medium windows where a permanent expanded rail would take too much space. Collapsed it behaves like a normal rail. Expanded it overlays the content with a scrim.

With hideOnCollapse the rail disappears completely when collapsed, which suits focused tasks.

Playground

The interactive page has a playground with live property controls for this component and generated code.

Examples

Expand over content

ModalRailDemo()

Parameters

NameTypeDefaultDescription
stateWideNavigationRailStaterememberWideNavigationRailState()Collapsed or Expanded.
hideOnCollapseBooleanfalseRemove the rail when collapsed.
header@Composable (() -> Unit)?nullMenu button or FAB.
railExpandedBooleanItem parameter, must match the state.

Guidelines

Do:

Don't:

Accessibility

Related components