Navigation rail group
ProA rail destination that opens a secondary column of links on hover or focus, and folds as an accordion in an expanded rail. Not an M3 component (@windmorph/react-pro).
import { NavigationRailGroup, NavigationRailGroupItem } from '@windmorph/react-pro';Part of Windmorph Pro, paid components on the free core, not on sale yet. See the Pro guide for what it includes and to register interest.
Props
NavigationRailGroup 19 props
Events
Text
NavigationRailGroupItem 9 props
Spec status
Not part of Material Design 3: a Windmorph Pro component, built on M3's colour roles, type scale, shapes and motion. Its variants and configurations each link to a live example.
Theming & tokens
Set the tokens below on the group or any ancestor. Its trigger is the core's NavigationRailItem, so the rail's own tokens paint it. Style each part with classNames: root, trigger, triggerIndicator, triggerIcon, triggerLabel, column, columnDivider, columnContent, heading, items, item, itemLabel, itemTrailing, accordion.
| Variable | Default | Paints |
|---|---|---|
--wm-navigation-rail-group-column-width | 272px | The secondary column’s width while open. |
--wm-navigation-rail-group-column-top-inset | 0px | The space between the rail’s top and the column’s. |
--wm-navigation-rail-group-container-color | var(--md-sys-color-surface-container) | The column’s surface. |
--wm-navigation-rail-group-end-corner | var(--md-sys-shape-corner-large) | The corners on the column’s end edge. |
--wm-navigation-rail-group-elevation | 2px 0 8px 0 color-mix(in srgb, var(--md-sys-color-shadow) 20%, transparent) | The shadow on the panel’s end edge. |
--wm-navigation-rail-group-elevation-rtl | -2px 0 8px 0 color-mix(in srgb, var(--md-sys-color-shadow) 20%, transparent) | The same shadow in right to left. |
--wm-navigation-rail-group-divider-color | var(--md-sys-color-outline-variant) | The line between the rail and the column. |
--wm-navigation-rail-group-heading-color | var(--md-sys-color-on-surface-variant) | The column’s heading. |
--wm-navigation-rail-group-heading-padding | 16px | The space around the column’s heading. |
--wm-navigation-rail-group-items-padding | 8px | The space around the column’s links. |
--wm-navigation-rail-group-item-height | 48px | A link’s height at density 0; each density step takes 4px off. |
--wm-navigation-rail-group-item-shape | var(--md-sys-shape-corner-full) | A link’s corners. |
--wm-navigation-rail-group-item-padding | 16px | The space at a link’s sides. |
--wm-navigation-rail-group-item-gap | 8px | The space between a link’s label and what trails it. |
--wm-navigation-rail-group-item-color | var(--md-sys-color-on-surface-variant) | A link’s text. |
--wm-navigation-rail-group-item-current-container-color | var(--md-sys-color-secondary-container) | The current link’s fill. |
--wm-navigation-rail-group-item-current-color | var(--md-sys-color-on-secondary-container) | The current link’s text. |
--wm-navigation-rail-group-item-disabled-color | color-mix(in srgb, var(--md-sys-color-on-surface) calc(var(--md-sys-state-disabled-content-opacity) * 100%), transparent) | A disabled link’s text. |
--wm-navigation-rail-group-open-duration | var(--md-sys-motion-spring-spatial-default-duration) | How long the column’s width and fade take to open. |
--wm-navigation-rail-group-open-easing | var(--md-sys-motion-spring-spatial-default-easing) | The curve of the column’s width and fade as it opens. |
--wm-navigation-rail-group-close-duration | var(--md-sys-motion-spring-spatial-fast-duration) | How long the column’s width and fade take to close. |
--wm-navigation-rail-group-close-easing | var(--md-sys-motion-spring-effects-default-easing) | The curve of the column’s width as it closes, which never overshoots. |
--wm-navigation-rail-group-fade-duration | var(--md-sys-motion-spring-effects-default-duration) | How long the column takes to fade under reduced motion. |
--wm-navigation-rail-group-fade-easing | var(--md-sys-motion-spring-effects-default-easing) | The curve of the column’s fade under reduced motion. |
--wm-navigation-rail-group-switch-duration | var(--md-sys-motion-duration-short-3) | How long a group’s links take to fade in as it takes the panel. |
--wm-navigation-rail-group-switch-easing | ease-out | The curve of the links’ fade as a group takes the panel. |
--wm-navigation-rail-group-accordion-inset | var(--m3-rail-item-inset, 20px) | The space at the accordion’s sides in an expanded rail, which lines its icon up with the rail’s items. |
--wm-navigation-rail-group-accordion-icon-gap | 12px | The space between the icon and the label in an expanded rail. |
--wm-navigation-rail-group-accordion-icon-size | 24px | The icon in an expanded rail. |
--wm-navigation-rail-group-accordion-label-color | var(--md-comp-nav-rail-item-inactive-label-text-color, var(--md-sys-color-on-surface-variant)) | The label in an expanded rail, as the rail’s own item labels (their `--md-comp-nav-rail-item-inactive-label-text-color` when set). |