Navigation menu
Site navigation with links and panels.
In Brand expressive
See it live
npm run storybookWhen to use it
In Brand expressive: The site sections.
- 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:
Words
- Headlines are short and bold. Three to six words.
- Verbs that move: Join, Try, Go.
- Playful in headlines, plain in errors.
- Use: Join, Drop, Go, Love. Avoid: Synergy, Leverage, Kindly.
The labels components use, from the voice tokens:
content.action.commit: Gocontent.action.cancel: Not nowcontent.action.destroy: Removecontent.action.retry: Try againcontent.action.empty-action: Explore the drop
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.
Brand expressive decides what changes when you switch theme. Here a switch changes colors only, so the marked rows differ between light and dark; everything else holds steady.
| Part | Its token and the semantic it aliases | Value |
|---|---|---|
| Shared | ||
| Transition panels duration | component.transition.panels-durationmotion.duration.panelsvar(--transition-panels-duration) | duration.moderate:200ms |
| List | ||
| Gap | component.navigation-menu.list.gapspace.gap.tightvar(--navigation-menu-list-gap) | space.8:0.5rem |
| Navigation menu | ||
| Corner | component.navigation-menu.radiusradius.controlvar(--navigation-menu-radius) | radius.999:9999px |
| Fill Changes with theme | component.navigation-menu.backgroundcolor.surface.canvasvar(--navigation-menu-background) | Lighttaupe.light.50:#FFF8F3Darktaupe.dark.0:#120B09 |
| Padding, left and right | component.navigation-menu.padding-xspace.inset.containervar(--navigation-menu-padding-x) | space.32:2rem |
| Padding, top and bottom | component.navigation-menu.padding-ycomponent-spacing-map.x2var(--navigation-menu-padding-y) | space.8:0.5rem |
| Text size | component.navigation-menu.font-sizetype.body.font-sizevar(--navigation-menu-font-size) | font.size.17:1.0625rem |
| Weight | component.navigation-menu.font-weighttype.label.font-weightvar(--navigation-menu-font-weight) | font.weight.700:700 |
| Background hover Changes with theme on hover | component.navigation-menu.background-hovercolor.surface.sunkenvar(--navigation-menu-background-hover) | Lighttaupe.light.100:#FCEFE6Darktaupe.dark.100:#33241F |
| Label hover Changes with theme on hover | component.navigation-menu.label-hovercolor.text.primaryvar(--navigation-menu-label-hover) | Lighttaupe.light.900:#1F1411Darktaupe.dark.900:#FFF8F3 |
| Background focus Changes with theme on focus | component.navigation-menu.background-focuscolor.surface.sunkenvar(--navigation-menu-background-focus) | Lighttaupe.light.100:#FCEFE6Darktaupe.dark.100:#33241F |
| Label focus Changes with theme on focus | component.navigation-menu.label-focuscolor.text.primaryvar(--navigation-menu-label-focus) | Lighttaupe.light.900:#1F1411Darktaupe.dark.900:#FFF8F3 |
| 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) | Lighttaupe.light.100:#FCEFE6Darktaupe.dark.100:#33241F |
| Label open Changes with theme when open | component.navigation-menu.label-opencolor.text.primaryvar(--navigation-menu-label-open) | Lighttaupe.light.900:#1F1411Darktaupe.dark.900:#FFF8F3 |
| Background open hover Changes with theme when open, on hover | component.navigation-menu.background-open-hovercolor.surface.sunkenvar(--navigation-menu-background-open-hover) | Lighttaupe.light.100:#FCEFE6Darktaupe.dark.100:#33241F |
| Background open focus Changes with theme when open, on focus | component.navigation-menu.background-open-focuscolor.surface.sunkenvar(--navigation-menu-background-open-focus) | Lighttaupe.light.100:#FCEFE6Darktaupe.dark.100:#33241F |
| Focus on focus | component.navigation-menu.focusborder-width.focusvar(--navigation-menu-focus) | border-width.3:3px |
| Focus ring focus Changes with theme on focus | component.navigation-menu.focus-ring-focuscolor.border.focusvar(--navigation-menu-focus-ring-focus) | Lightpink.light.600:#D61F7ADarkpink.dark.600:#F59ACA |
| Focus ring offset focus Changes with theme on focus | component.navigation-menu.focus-ring-offset-focuscolor.surface.canvasvar(--navigation-menu-focus-ring-offset-focus) | Lighttaupe.light.50:#FFF8F3Darktaupe.dark.0:#120B09 |
| Speed | component.navigation-menu.durationmotion.duration.feedbackvar(--navigation-menu-duration) | duration.fast:120ms |
| Background 2 Changes with theme | component.navigation-menu.background-2color.surface.raisedvar(--navigation-menu-background-2) | Lighttaupe.light.0:#FFFFFFDarktaupe.dark.100:#33241F |
| Text Changes with theme | component.navigation-menu.labelcolor.text.primaryvar(--navigation-menu-label) | Lighttaupe.light.900:#1F1411Darktaupe.dark.900:#FFF8F3 |
| Shadow Changes with theme | component.navigation-menu.shadowelevation.cardvar(--navigation-menu-shadow) | Lightshadow.cardDarkshadow.card-dark |
| Background 3 Changes with theme | component.navigation-menu.background-3color.border.defaultvar(--navigation-menu-background-3) | Lighttaupe.light.200:#F2DCCFDarktaupe.dark.100:#33241F |
| Shadow 2 Changes with theme | component.navigation-menu.shadow-2elevation.overlayvar(--navigation-menu-shadow-2) | Lightshadow.overlay:0px 24px 48px 0px #1F141133Darkshadow.overlay-dark:0px 24px 48px 0px #00000099 |
| Content | ||
| Padding | component.navigation-menu.content.paddingcomponent-spacing-map.x2var(--navigation-menu-content-padding) | space.8:0.5rem |
| Padding right | component.navigation-menu.content.padding-rightcomponent-spacing-map.x3var(--navigation-menu-content-padding-right) | space.24:1.5rem |
| Viewport | ||
| Corner | component.navigation-menu.viewport.radiusradius.controlvar(--navigation-menu-viewport-radius) | radius.999:9999px |
| Fill Changes with theme | component.navigation-menu.viewport.backgroundcolor.surface.raisedvar(--navigation-menu-viewport-background) | Lighttaupe.light.0:#FFFFFFDarktaupe.dark.100:#33241F |
| Text Changes with theme | component.navigation-menu.viewport.labelcolor.text.primaryvar(--navigation-menu-viewport-label) | Lighttaupe.light.900:#1F1411Darktaupe.dark.900:#FFF8F3 |
| Shadow Changes with theme | component.navigation-menu.viewport.shadowelevation.cardvar(--navigation-menu-viewport-shadow) | Lightshadow.cardDarkshadow.card-dark |
| Link | ||
| Gap | component.navigation-menu.link.gapspace.gap.tightvar(--navigation-menu-link-gap) | space.8:0.5rem |
| Corner | component.navigation-menu.link.radiusradius.badgevar(--navigation-menu-link-radius) | radius.999:9999px |
| Padding | component.navigation-menu.link.paddingcomponent-spacing-map.x2var(--navigation-menu-link-padding) | space.8:0.5rem |
| Text size | component.navigation-menu.link.font-sizetype.body.font-sizevar(--navigation-menu-link-font-size) | font.size.17:1.0625rem |
| Background hover Changes with theme on hover | component.navigation-menu.link.background-hovercolor.surface.sunkenvar(--navigation-menu-link-background-hover) | Lighttaupe.light.100:#FCEFE6Darktaupe.dark.100:#33241F |
| Label hover Changes with theme on hover | component.navigation-menu.link.label-hovercolor.text.primaryvar(--navigation-menu-link-label-hover) | Lighttaupe.light.900:#1F1411Darktaupe.dark.900:#FFF8F3 |
| Background focus Changes with theme on focus | component.navigation-menu.link.background-focuscolor.surface.sunkenvar(--navigation-menu-link-background-focus) | Lighttaupe.light.100:#FCEFE6Darktaupe.dark.100:#33241F |
| Label focus Changes with theme on focus | component.navigation-menu.link.label-focuscolor.text.primaryvar(--navigation-menu-link-label-focus) | Lighttaupe.light.900:#1F1411Darktaupe.dark.900:#FFF8F3 |
| Fill Changes with theme | component.navigation-menu.link.backgroundcolor.surface.sunkenvar(--navigation-menu-link-background) | Lighttaupe.light.100:#FCEFE6Darktaupe.dark.100:#33241F |
| Focus | component.navigation-menu.link.focusborder-width.focusvar(--navigation-menu-link-focus) | border-width.3:3px |
| Text Changes with theme | component.navigation-menu.link.labelcolor.text.primaryvar(--navigation-menu-link-label) | Lighttaupe.light.900:#1F1411Darktaupe.dark.900:#FFF8F3 |
| Icon size | component.navigation-menu.link.icon-sizesize.iconvar(--navigation-menu-link-icon-size) | size.20:1.25rem |
| Label 2 Changes with theme | component.navigation-menu.link.label-2color.text.mutedvar(--navigation-menu-link-label-2) | Lighttaupe.light.600:#6B544ADarktaupe.dark.400:#B5988A |
| Focus ring focus Changes with theme on focus | component.navigation-menu.link.focus-ring-focuscolor.border.focusvar(--navigation-menu-link-focus-ring-focus) | Lightpink.light.600:#D61F7ADarkpink.dark.600:#F59ACA |
| 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) | Lighttaupe.light.50:#FFF8F3Darktaupe.dark.0:#120B09 |
| From the system | ||
| Edge Changes with theme | color.border.default straight from the system, through --border | Lighttaupe.light.200 · #F2DCCFDarktaupe.dark.100 · #33241F |
| Corner | radius.badge straight from the system, through --radius-sm | radius.999 · 9999px |