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.
Purpose
A rail destination that opens a secondary column of links, for a site whose sections have many pages. It sits directly in a core NavigationRail, beside its items. With a handful of destinations, use NavigationRailItem alone.
Behaviour
- Collapsed, a group is a real link to
hrefor its first item, so a press, a middle click, a new tab and no script all work. - A mouse or pen rests for
openDelayto open the column, and leaving keeps it forcloseDelay; a pointer on its way into an open column doesn't switch groups. Keyboard focus opens it at once, and touch only navigates. - One column is open in a rail. With
pinned, the current group's column stays open beside the rail and others preview over it; leave room for it in your layout with thecolumn-widthtoken. - The current route comes from
currentPath, matched by whole path segments with the longest match winning. The matching link getsaria-current="page". - In an expanded rail, or its modal sheet, the same group is an accordion. With
hideOnCollapse="compact"on the rail, one rail serves every window size. - Links go through React Aria's
RouterProvider, so no framework is imported.
When not to use
With a handful of destinations, use NavigationRailItem alone.
See also
- Navigation rail: Top-level destinations along the start edge, collapsed or expanded, in medium windows.
- Accordion: A stack of headers that open and fold panels of content, one at a time or several: FAQs, settings groups, product details and filters. Not an M3 component (@windmorph/react-pro).