Navigation

Sidebar

The shell's navigation column: groups, icon slots, a footer, and a rail form when narrow.

Examples

Rail, labels hidden

The shell's data-rail makes the column narrow; data-labels="hidden" leaves only the icons.
Main content

Anatomy

nav.sidebarA sticky, scrolling column. Usually the first child of a .shell, which sets its width (see Shell).
> h6, > details > summaryGroup headings. A <details> group collapses; its summary carries a chevron.
aOne destination. Optional > i icon slot and a > span label, which the rail form needs.
> footerOptional. Pushed to the bottom, for the account or settings.

API

AttributeValuesDescription
aria-currentpageOn a link: accent text, tint and an accent edge on the start side.
data-labelshiddenIn the rail form, hides the <span> labels visually (they stay readable to screen readers). Default shows them small under the icon.

Accessibility

  • Use <nav> with an aria-label ("Main") so it is a named landmark.
  • In the rail form give every link a <span> label, even with data-labels="hidden": it is the link's accessible name.
  • Under 48rem the sidebar becomes a horizontal scrolling row and hides headings and the footer, so don't put anything there that has no other route.
Jump to
ProportionFoundations
MaterialFoundations
PresetsFoundations
ShellLayouts · Application
Container and stacksLayouts · Pages
SplitLayouts · Pages
Grid, bento, masonryLayouts · Pages
Switcher and rowLayouts · Pages
↑↓Move↵OpenescClose