Skip to content

Navigation

TabNav

Links to subpages that look like tabs. Navigation, not an ARIA tablist: every item has its own URL.

  • Experimental
  • Keyboard tested
  • Screen reader not tested yet

Updated 2026-11-12

Playground

Change the props. The controls come from the documented props.
tsx
<TabNav
  label="Playground subpages"
  current="#overview"
  items={[
    { label: "Overview", href: "#overview" },
    { label: "Usage", href: "#usage" },
    { label: "Code", href: "#code" },
  ]}
/>

Usage

When to use

Use TabNav for two to five subpages of one topic that each have their own URL, such as a component's Overview, Usage, Code and Accessibility pages.

When not to use

  • To switch panels on the same page without a URL: use Tabs.
  • For the main navigation: use Nav.

How it works

Links styled as tabs, with the current page marked by aria-current and an underline. It is navigation, not an ARIA tablist: screen readers announce links, which is what they are.

Content guidelines

Labels are one word where possible and match the page titles.

Do and don’t

Do
  • For two to five subpages of one topic, such as a component's tabs.
Don’t
  • Don't use it to switch panels without a URL; use Tabs.

Anatomy

The parts of the component and what each one does, as in the playground above.
  1. link14px medium; the current page in text.primary.
  2. indicator2px accent line under the current page.

Examples

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

Component subpages

Props

Checked against the component's TypeScript type on every build.
TabNav props
NameTypeDefaultDescription
label (required)string–Accessible name of the landmark, unique per page.
items (required)TabNavItem[]–label and href per subpage.
current (required)string–Path of the current page.

Tokens used

Derived from the utility classes in the component's source. Copy a class with one click.
Tokens used by TabNav
TokenTierValueUtility
button.radiuscomponent9999px
tabs.bordercomponentrgba(10,10,11,0.08)
tabs.fgcomponent#555555
tabs.fgHovercomponent#0A0A0B
tabs.fgSelectedcomponent#0A0A0B
tabs.indicatorcomponent#C6492E
focussemantic#C6492E
spacing.0semantic0px
spacing.3semantic12px
spacing.6semantic24px
surface.pagesemantic#FAFAF7
type.small.sizesemantic14px
weight.mediumsemantic500

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

TabNav keyboard interactions
KeyAction
TabMoves from link to link.
EnterOpens the subpage.

Semantics and focus

  • A <nav> with links; the current page has aria-current="page".
  • No tablist role: screen readers announce links, which is what they are.

Contrast

TabNav contrast pairings
PairingRatio (x:1)MinimumStatus
text.primary on surface.page18.924.5Pass
text.secondary on surface.page7.134.5Pass
accent.default on surface.page4.574.5Pass
focus on surface.page4.573.0Pass