Skip to content

Navigation

SideNav

Section navigation with collapsible groups; a column on large screens, a drawer below.

  • Experimental
  • Keyboard tested
  • Screen reader not tested yet

Updated 2026-11-12

Playground

Change the props. The controls come from the documented props.
tsx
<SideNav
  label="Playground section"
  current="#button"
  groups={[
    {
      label: "Actions",
      items: [{ label: "Button", href: "#button" }, { label: "Link", href: "#link" }],
    },
  ]}
/>

Usage

When to use

Use the side navigation for the pages within one section of a site, such as all components or all foundations.

When not to use

  • For the main site navigation: use Nav.
  • For a few subpages of one topic: use TabNav.

How it works

Collapsible groups with toggles that report their state. On large screens it is a column next to the content; below that it becomes a drawer behind a “Browse” button, with focus trapped inside and Esc to close. The current page is marked with aria-current.

Content guidelines

Group entries the way people look for them, not the way the code is organised. One level of groups at most.

Do and don’t

Do
  • Group entries the way people look for them, not the way the code is organised.
Don’t
  • Don't nest groups deeper than one level.

Anatomy

The parts of the component and what each one does, as in the playground above.
  1. groupCollapsible group with a toggle button.
  2. link14px link; the current page has a 2px accent line on the left.
  3. triggerBelow lg, opens the drawer.
  4. panelDrawer from the left with the same groups.

Examples

Type-checked, and the same code goes into the AI manifest. Import: import { SideNav } from "@/ds";

Two groups

Props

Checked against the component's TypeScript type on every build.
SideNav props
NameTypeDefaultDescription
label (required)string–Accessible name, e.g. the section name.
groups (required)SideNavGroup[]–Groups with a label and links.
current (required)string–Path of the current page.
menuLabelstring"Browse"Label of the drawer button below lg.

Tokens used

Derived from the utility classes in the component's source. Copy a class with one click.
Tokens used by SideNav
TokenTierValueUtility
button.radiuscomponent9999px
dialog.backdropcomponentrgba(10,10,11,0.20)
eyebrow.trackingcomponent0.18em
sideNav.bgcomponent#EFEDE6
sideNav.bordercomponentrgba(10,10,11,0.08)
sideNav.groupFgcomponent#555555
sideNav.link.bgCurrentcomponent#FFFFFF
sideNav.link.bgHovercomponent#E7E3DA
sideNav.link.fgcomponent#555555
sideNav.link.fgCurrentcomponent#0A0A0B
sideNav.link.fgHovercomponent#0A0A0B
sideNav.link.indicatorcomponent#C6492E
sideNav.link.radiuscomponent8px
focussemantic#C6492E
spacing.0semantic0px
spacing.1semantic4px
spacing.2semantic8px
spacing.3semantic12px
spacing.4semantic16px
spacing.6semantic24px
surface.pagesemantic#FAFAF7
text.primarysemantic#0A0A0B
type.meta.sizesemantic13px
type.small.sizesemantic14px
weight.mediumsemantic500
weight.semiboldsemantic600

Accessibility

What is checked automatically on every build, and what a person has tested. Nothing is marked as tested unless it was.
Testing status by check
CheckHowStatus
axe-core rulesAutomated on every npm run check, at desktop and mobile widthRuns on every build
KeyboardAutomated Playwright test (scripts/keyboard.mjs)Tested
Screen readerManualNot tested yet

Keyboard

SideNav keyboard interactions
KeyAction
TabMoves through group toggles and links.
Enter / SpaceCollapses or expands a group; opens the drawer.
EscCloses the drawer.

Semantics and focus

  • Named <nav>; current page aria-current="page", its parent aria-current="location".
  • Group toggles with aria-expanded and aria-controls.
  • Drawer is a React Aria modal: focus is trapped, Esc closes, focus returns to the trigger.

Contrast

SideNav contrast pairings
PairingRatio (x:1)MinimumStatus
text.primary on surface.page18.924.5Pass
text.primary on surface.card19.794.5Pass
text.secondary on surface.page7.134.5Pass
text.secondary on surface.card7.464.5Pass
accent.default on surface.page4.574.5Pass
accent.default on surface.card4.784.5Pass
focus on surface.page4.573.0Pass
focus on surface.card4.783.0Pass
text.primary on surface.subtle15.454.5Pass
text.primary on surface.sunken16.894.5Pass
text.secondary on surface.sunken6.364.5Pass
focus on surface.sunken4.083.0Pass
accent.default on surface.sunken4.083.0Pass
text.secondary on surface.subtle5.824.5Pass