Skip to main content

Navigation menu

Site navigation with links and panels.

In Multi-brand

See it live​

Start Storybook to see it live: npm run storybook

When to use it​

In Multi-brand: Brand site navigation.

  • Use it when: The main sections of a website, sometimes with a panel of sub-links.
  • Not when: App navigation that stays open (sidebar), or actions (dropdown menu).

Instead:

  • Sidebar: App navigation that stays open.
  • Tabs: Views of one thing.

Words​

  • Shared structure: object, state, next step.
  • Brand tone lives in headlines and marketing copy, not in errors.
  • Errors and confirmations read the same in every brand.
  • Use: Get started, Plan, Order. Avoid: Brand-specific words in errors, Jargon.

The labels components use, from the voice tokens:

  • content.action.commit: Save
  • content.action.cancel: Cancel
  • content.action.destroy: Remove
  • content.action.retry: Try again
  • content.action.empty-action: Get started

See Voice and tone for the whole voice.

Accessibility and keyboard​

Test before you ship:

  • It is a navigation landmark; the current page is marked. undefined

Use it in code​

npx open-ds add navigation-menu

The component reads only component keys and semantic tokens, so it follows the brand and mode on <html>.

Tokens it reads​

Navigation menu reads 47 tokens of its own, each an alias of a semantic token. Each row is one part: its own token, the semantic it aliases, and the value it ends at. Change a semantic and every component that reads it follows; override one of Navigation menu's tokens to change Navigation menu alone.

Changes with theme

Multi-brand decides what changes when you switch theme. Here a switch changes colors, type and shape, so the marked rows differ between its brands and between light and dark; everything else holds steady.

PartIts token and the semantic it aliasesValue
Shared
Transition panels durationcomponent.transition.panels-durationmotion.duration.panelsvar(--transition-panels-duration)duration.relaxed:320ms
List
Gapcomponent.navigation-menu.list.gapspace.gap.tightvar(--navigation-menu-list-gap)space.8:0.5rem
Navigation menu
Corner
Changes with theme
component.navigation-menu.radiusradius.controlvar(--navigation-menu-radius)Aster Lightradius.4:0.25remAster Darkradius.4:0.25remBirch Lightradius.12:0.75remBirch Darkradius.12:0.75remCoral Lightradius.999:9999pxCoral Darkradius.999:9999px
Fill
Changes with theme
component.navigation-menu.backgroundcolor.surface.canvasvar(--navigation-menu-background)Aster Lightslate-deep.light.50:#F8FAFCAster Darkslate-deep.dark.0:#020617Birch Lightslate-deep.light.50:#F8FAFCBirch Darkslate-deep.dark.0:#020617Coral Lightslate-deep.light.50:#F8FAFCCoral Darkslate-deep.dark.0:#020617
Padding, left and rightcomponent.navigation-menu.padding-xspace.inset.containervar(--navigation-menu-padding-x)space.24:1.5rem
Padding, top and bottomcomponent.navigation-menu.padding-ycomponent-spacing-map.x2var(--navigation-menu-padding-y)space.8:0.5rem
Text sizecomponent.navigation-menu.font-sizetype.body.font-sizevar(--navigation-menu-font-size)font.size.16:1rem
Weightcomponent.navigation-menu.font-weighttype.label.font-weightvar(--navigation-menu-font-weight)font.weight.600:600
Background hover
Changes with theme
on hover
component.navigation-menu.background-hovercolor.surface.sunkenvar(--navigation-menu-background-hover)Aster Lightslate-deep.light.100:#F1F5F9Aster Darkslate-deep.dark.100:#1E293BBirch Lightslate-deep.light.100:#F1F5F9Birch Darkslate-deep.dark.100:#1E293BCoral Lightslate-deep.light.100:#F1F5F9Coral Darkslate-deep.dark.100:#1E293B
Label hover
Changes with theme
on hover
component.navigation-menu.label-hovercolor.text.primaryvar(--navigation-menu-label-hover)Aster Lightslate-deep.light.900:#0F172AAster Darkslate-deep.dark.900:#F8FAFCBirch Lightslate-deep.light.900:#0F172ABirch Darkslate-deep.dark.900:#F8FAFCCoral Lightslate-deep.light.900:#0F172ACoral Darkslate-deep.dark.900:#F8FAFC
Background focus
Changes with theme
on focus
component.navigation-menu.background-focuscolor.surface.sunkenvar(--navigation-menu-background-focus)Aster Lightslate-deep.light.100:#F1F5F9Aster Darkslate-deep.dark.100:#1E293BBirch Lightslate-deep.light.100:#F1F5F9Birch Darkslate-deep.dark.100:#1E293BCoral Lightslate-deep.light.100:#F1F5F9Coral Darkslate-deep.dark.100:#1E293B
Label focus
Changes with theme
on focus
component.navigation-menu.label-focuscolor.text.primaryvar(--navigation-menu-label-focus)Aster Lightslate-deep.light.900:#0F172AAster Darkslate-deep.dark.900:#F8FAFCBirch Lightslate-deep.light.900:#0F172ABirch Darkslate-deep.dark.900:#F8FAFCCoral Lightslate-deep.light.900:#0F172ACoral Darkslate-deep.dark.900:#F8FAFC
Disabled opacity disabled
when disabled
component.navigation-menu.disabled-opacity-disabledopacity.disabledvar(--navigation-menu-disabled-opacity-disabled)opacity.40:0.4
Background open
Changes with theme
when open
component.navigation-menu.background-opencolor.surface.sunkenvar(--navigation-menu-background-open)Aster Lightslate-deep.light.100:#F1F5F9Aster Darkslate-deep.dark.100:#1E293BBirch Lightslate-deep.light.100:#F1F5F9Birch Darkslate-deep.dark.100:#1E293BCoral Lightslate-deep.light.100:#F1F5F9Coral Darkslate-deep.dark.100:#1E293B
Label open
Changes with theme
when open
component.navigation-menu.label-opencolor.text.primaryvar(--navigation-menu-label-open)Aster Lightslate-deep.light.900:#0F172AAster Darkslate-deep.dark.900:#F8FAFCBirch Lightslate-deep.light.900:#0F172ABirch Darkslate-deep.dark.900:#F8FAFCCoral Lightslate-deep.light.900:#0F172ACoral Darkslate-deep.dark.900:#F8FAFC
Background open hover
Changes with theme
when open, on hover
component.navigation-menu.background-open-hovercolor.surface.sunkenvar(--navigation-menu-background-open-hover)Aster Lightslate-deep.light.100:#F1F5F9Aster Darkslate-deep.dark.100:#1E293BBirch Lightslate-deep.light.100:#F1F5F9Birch Darkslate-deep.dark.100:#1E293BCoral Lightslate-deep.light.100:#F1F5F9Coral Darkslate-deep.dark.100:#1E293B
Background open focus
Changes with theme
when open, on focus
component.navigation-menu.background-open-focuscolor.surface.sunkenvar(--navigation-menu-background-open-focus)Aster Lightslate-deep.light.100:#F1F5F9Aster Darkslate-deep.dark.100:#1E293BBirch Lightslate-deep.light.100:#F1F5F9Birch Darkslate-deep.dark.100:#1E293BCoral Lightslate-deep.light.100:#F1F5F9Coral Darkslate-deep.dark.100:#1E293B
Focus
on focus
component.navigation-menu.focusborder-width.focusvar(--navigation-menu-focus)border-width.2:2px
Focus ring focus
Changes with theme
on focus
component.navigation-menu.focus-ring-focuscolor.border.focusvar(--navigation-menu-focus-ring-focus)Aster Lightteal.light.600:#0F766EAster Darkteal.dark.600:#7FCFC6Birch Lightpurple.light.600:#6D28D9Birch Darkpurple.dark.600:#B79DF7Coral Lightorange.light.600:#C2410CCoral Darkorange.dark.600:#F7A67F
Focus ring offset focus
Changes with theme
on focus
component.navigation-menu.focus-ring-offset-focuscolor.surface.canvasvar(--navigation-menu-focus-ring-offset-focus)Aster Lightslate-deep.light.50:#F8FAFCAster Darkslate-deep.dark.0:#020617Birch Lightslate-deep.light.50:#F8FAFCBirch Darkslate-deep.dark.0:#020617Coral Lightslate-deep.light.50:#F8FAFCCoral Darkslate-deep.dark.0:#020617
Speedcomponent.navigation-menu.durationmotion.duration.feedbackvar(--navigation-menu-duration)duration.moderate:200ms
Background 2
Changes with theme
component.navigation-menu.background-2color.surface.raisedvar(--navigation-menu-background-2)Aster Lightslate-deep.light.0:#FFFFFFAster Darkslate-deep.dark.100:#1E293BBirch Lightslate-deep.light.0:#FFFFFFBirch Darkslate-deep.dark.100:#1E293BCoral Lightslate-deep.light.0:#FFFFFFCoral Darkslate-deep.dark.100:#1E293B
Text
Changes with theme
component.navigation-menu.labelcolor.text.primaryvar(--navigation-menu-label)Aster Lightslate-deep.light.900:#0F172AAster Darkslate-deep.dark.900:#F8FAFCBirch Lightslate-deep.light.900:#0F172ABirch Darkslate-deep.dark.900:#F8FAFCCoral Lightslate-deep.light.900:#0F172ACoral Darkslate-deep.dark.900:#F8FAFC
Shadow
Changes with theme
component.navigation-menu.shadowelevation.cardvar(--navigation-menu-shadow)Aster Lightshadow.cardAster Darkshadow.card-darkBirch Lightshadow.cardBirch Darkshadow.card-darkCoral Lightshadow.cardCoral Darkshadow.card-dark
Background 3
Changes with theme
component.navigation-menu.background-3color.border.defaultvar(--navigation-menu-background-3)Aster Lightslate-deep.light.200:#E2E8F0Aster Darkslate-deep.dark.100:#1E293BBirch Lightslate-deep.light.200:#E2E8F0Birch Darkslate-deep.dark.100:#1E293BCoral Lightslate-deep.light.200:#E2E8F0Coral Darkslate-deep.dark.100:#1E293B
Shadow 2
Changes with theme
component.navigation-menu.shadow-2elevation.overlayvar(--navigation-menu-shadow-2)Aster Lightshadow.overlay:0px 12px 32px 0px #0F172A29Aster Darkshadow.overlay-dark:0px 12px 32px 0px #00000080Birch Lightshadow.overlay:0px 12px 32px 0px #0F172A29Birch Darkshadow.overlay-dark:0px 12px 32px 0px #00000080Coral Lightshadow.overlay:0px 12px 32px 0px #0F172A29Coral Darkshadow.overlay-dark:0px 12px 32px 0px #00000080
Content
Paddingcomponent.navigation-menu.content.paddingcomponent-spacing-map.x2var(--navigation-menu-content-padding)space.8:0.5rem
Padding rightcomponent.navigation-menu.content.padding-rightcomponent-spacing-map.x3var(--navigation-menu-content-padding-right)space.20:1.25rem
Viewport
Corner
Changes with theme
component.navigation-menu.viewport.radiusradius.controlvar(--navigation-menu-viewport-radius)Aster Lightradius.4:0.25remAster Darkradius.4:0.25remBirch Lightradius.12:0.75remBirch Darkradius.12:0.75remCoral Lightradius.999:9999pxCoral Darkradius.999:9999px
Fill
Changes with theme
component.navigation-menu.viewport.backgroundcolor.surface.raisedvar(--navigation-menu-viewport-background)Aster Lightslate-deep.light.0:#FFFFFFAster Darkslate-deep.dark.100:#1E293BBirch Lightslate-deep.light.0:#FFFFFFBirch Darkslate-deep.dark.100:#1E293BCoral Lightslate-deep.light.0:#FFFFFFCoral Darkslate-deep.dark.100:#1E293B
Text
Changes with theme
component.navigation-menu.viewport.labelcolor.text.primaryvar(--navigation-menu-viewport-label)Aster Lightslate-deep.light.900:#0F172AAster Darkslate-deep.dark.900:#F8FAFCBirch Lightslate-deep.light.900:#0F172ABirch Darkslate-deep.dark.900:#F8FAFCCoral Lightslate-deep.light.900:#0F172ACoral Darkslate-deep.dark.900:#F8FAFC
Shadow
Changes with theme
component.navigation-menu.viewport.shadowelevation.cardvar(--navigation-menu-viewport-shadow)Aster Lightshadow.cardAster Darkshadow.card-darkBirch Lightshadow.cardBirch Darkshadow.card-darkCoral Lightshadow.cardCoral Darkshadow.card-dark
Link
Gapcomponent.navigation-menu.link.gapspace.gap.tightvar(--navigation-menu-link-gap)space.8:0.5rem
Corner
Changes with theme
component.navigation-menu.link.radiusradius.badgevar(--navigation-menu-link-radius)Aster Lightradius.4:0.25remAster Darkradius.4:0.25remBirch Lightradius.999:9999pxBirch Darkradius.999:9999pxCoral Lightradius.999:9999pxCoral Darkradius.999:9999px
Paddingcomponent.navigation-menu.link.paddingcomponent-spacing-map.x2var(--navigation-menu-link-padding)space.8:0.5rem
Text sizecomponent.navigation-menu.link.font-sizetype.body.font-sizevar(--navigation-menu-link-font-size)font.size.16:1rem
Background hover
Changes with theme
on hover
component.navigation-menu.link.background-hovercolor.surface.sunkenvar(--navigation-menu-link-background-hover)Aster Lightslate-deep.light.100:#F1F5F9Aster Darkslate-deep.dark.100:#1E293BBirch Lightslate-deep.light.100:#F1F5F9Birch Darkslate-deep.dark.100:#1E293BCoral Lightslate-deep.light.100:#F1F5F9Coral Darkslate-deep.dark.100:#1E293B
Label hover
Changes with theme
on hover
component.navigation-menu.link.label-hovercolor.text.primaryvar(--navigation-menu-link-label-hover)Aster Lightslate-deep.light.900:#0F172AAster Darkslate-deep.dark.900:#F8FAFCBirch Lightslate-deep.light.900:#0F172ABirch Darkslate-deep.dark.900:#F8FAFCCoral Lightslate-deep.light.900:#0F172ACoral Darkslate-deep.dark.900:#F8FAFC
Background focus
Changes with theme
on focus
component.navigation-menu.link.background-focuscolor.surface.sunkenvar(--navigation-menu-link-background-focus)Aster Lightslate-deep.light.100:#F1F5F9Aster Darkslate-deep.dark.100:#1E293BBirch Lightslate-deep.light.100:#F1F5F9Birch Darkslate-deep.dark.100:#1E293BCoral Lightslate-deep.light.100:#F1F5F9Coral Darkslate-deep.dark.100:#1E293B
Label focus
Changes with theme
on focus
component.navigation-menu.link.label-focuscolor.text.primaryvar(--navigation-menu-link-label-focus)Aster Lightslate-deep.light.900:#0F172AAster Darkslate-deep.dark.900:#F8FAFCBirch Lightslate-deep.light.900:#0F172ABirch Darkslate-deep.dark.900:#F8FAFCCoral Lightslate-deep.light.900:#0F172ACoral Darkslate-deep.dark.900:#F8FAFC
Fill
Changes with theme
component.navigation-menu.link.backgroundcolor.surface.sunkenvar(--navigation-menu-link-background)Aster Lightslate-deep.light.100:#F1F5F9Aster Darkslate-deep.dark.100:#1E293BBirch Lightslate-deep.light.100:#F1F5F9Birch Darkslate-deep.dark.100:#1E293BCoral Lightslate-deep.light.100:#F1F5F9Coral Darkslate-deep.dark.100:#1E293B
Focuscomponent.navigation-menu.link.focusborder-width.focusvar(--navigation-menu-link-focus)border-width.2:2px
Text
Changes with theme
component.navigation-menu.link.labelcolor.text.primaryvar(--navigation-menu-link-label)Aster Lightslate-deep.light.900:#0F172AAster Darkslate-deep.dark.900:#F8FAFCBirch Lightslate-deep.light.900:#0F172ABirch Darkslate-deep.dark.900:#F8FAFCCoral Lightslate-deep.light.900:#0F172ACoral Darkslate-deep.dark.900:#F8FAFC
Icon sizecomponent.navigation-menu.link.icon-sizesize.iconvar(--navigation-menu-link-icon-size)size.16:1rem
Label 2
Changes with theme
component.navigation-menu.link.label-2color.text.mutedvar(--navigation-menu-link-label-2)Aster Lightslate-deep.light.600:#4B5A6FAster Darkslate-deep.dark.400:#96A3B5Birch Lightslate-deep.light.600:#4B5A6FBirch Darkslate-deep.dark.400:#96A3B5Coral Lightslate-deep.light.600:#4B5A6FCoral Darkslate-deep.dark.400:#96A3B5
Focus ring focus
Changes with theme
on focus
component.navigation-menu.link.focus-ring-focuscolor.border.focusvar(--navigation-menu-link-focus-ring-focus)Aster Lightteal.light.600:#0F766EAster Darkteal.dark.600:#7FCFC6Birch Lightpurple.light.600:#6D28D9Birch Darkpurple.dark.600:#B79DF7Coral Lightorange.light.600:#C2410CCoral Darkorange.dark.600:#F7A67F
Focus ring offset focus
Changes with theme
on focus
component.navigation-menu.link.focus-ring-offset-focuscolor.surface.canvasvar(--navigation-menu-link-focus-ring-offset-focus)Aster Lightslate-deep.light.50:#F8FAFCAster Darkslate-deep.dark.0:#020617Birch Lightslate-deep.light.50:#F8FAFCBirch Darkslate-deep.dark.0:#020617Coral Lightslate-deep.light.50:#F8FAFCCoral Darkslate-deep.dark.0:#020617
From the system
Edge
Changes with theme
color.border.default
straight from the system, through --border
Aster Lightslate-deep.light.200 · #E2E8F0Aster Darkslate-deep.dark.100 · #1E293BBirch Lightslate-deep.light.200 · #E2E8F0Birch Darkslate-deep.dark.100 · #1E293BCoral Lightslate-deep.light.200 · #E2E8F0Coral Darkslate-deep.dark.100 · #1E293B
Corner
Changes with theme
radius.badge
straight from the system, through --radius-sm
Aster Lightradius.4 · 0.25rem (4px)Aster Darkradius.4 · 0.25rem (4px)Birch Lightradius.999 · 9999pxBirch Darkradius.999 · 9999pxCoral Lightradius.999 · 9999pxCoral Darkradius.999 · 9999px