Skip to content

Navigation rail group

Pro

A 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 href or its first item, so a press, a middle click, a new tab and no script all work.
  • A mouse or pen rests for openDelay to open the column, and leaving keeps it for closeDelay; 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 the column-width token.
  • The current route comes from currentPath, matched by whole path segments with the longest match winning. The matching link gets aria-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).