Skip to content
Theme

Nav group

A titled section of the sidebar that folds away, such as recent concepts.

Examples

Props

NavGroup

A titled section of the sidebar that folds away, such as recent concepts. The title is a heading holding a button, so a screen reader can jump to it and hear whether it is open. In the rail, titles give way to a rule and every group shows its links.

PropTypeDefaultDescription
titlestring—The heading over the group's links, set as an overline.
childrenReactNode—NavItem elements.
defaultExpanded?booleantrue
isExpanded?boolean—Open or folded, for an app that keeps the reader's choice itself; leave it out to let the group keep it.
onExpandedChange?((expanded: boolean) => void)—Called when the reader opens or folds the group.

Keyboard

KeyDoes
Enter or SpaceFolds or unfolds the group

Accessibility

  • The title is a heading holding a button with aria-expanded, so a screen reader can jump to it and hear whether it is open.
  • A folded group's links are hidden from everyone. In the rail every group shows its links, under a rule instead of a title.