component
Menu
A navigation item: a label with a line underneath, used in the main nav.
When to use
- Moving between the main pages or sections.
When not to use
- Actions. That's Button, menu items take you somewhere.
- Mixing it up with the Menu effect (
effect-menu), which is the frosted surface the nav sits on.
Behaviour
Five states. The line part is the indicator. It marks the page you're on (aria-current), not where the mouse is.
Accessibility
- Element:
<a>, inside<nav aria-label="Main">and a list. - Current Page:
aria-current="page". That's also what the line is styled from. - Focus:
focus-ring, on:focus-visible. - Mobile: when it folds behind a button, that button gets
aria-expandedand controls the list.
Content
One word: the page's own title.
Props
| Prop | Type | Values | Default |
|---|---|---|---|
| title | slot | ||
| description | slot | ||
| showDescription | boolean | true | |
| showDivider | boolean | true |
States: Default, Hover, Pressed, Focus, Disabled.
Values
Straight from the contract. Each value sits next to its token, because six tokens here all come out as #3a3a3a and the colour alone can't tell you which one is right.
Never changes
| Part | Property | Value | Token |
|---|---|---|---|
| root | display | flex | layout |
| root | flex-direction | column | layout |
| root | align-items | flex-start | layout |
| root | position | relative | layout |
| root | gap | 24px | spacing/gap/large |
| root | padding-top | 24px | spacing/gap/large |
| root | text-decoration | none | Figma frame size |
| root | color | inherit | Figma frame size |
| root | outline | none | Figma frame size |
| root | width | 324px | Figma frame size |
| content | display | flex | layout |
| content | flex-direction | column | layout |
| content | align-items | flex-start | layout |
| content | width | 100% | layout |
| content | gap | 12px | spacing/gap/small-medium |
| content | font-family | 'General Sans Variable' | font-family/base |
| content | line-height | 22px | typography/body/line-height |
| content | font-size | 16px | typography/body/font-size |
| content | letter-spacing | 0px | typography/body/letter-spacing |
| title | width | 100% | layout |
| title | font-weight | 500 | typography/body/font-weight/medium |
| description | width | 100% | layout |
| description | font-weight | 400 | typography/body/font-weight/regular |
| divider | width | 100% | layout |
| divider | flex-shrink | 0 | layout |
| focus-ring | display | none | layout |
| focus-ring | position | absolute | layout |
| focus-ring | inset | var(--spacing-gap-medium-large) calc(-1 * var(--spacing-gap-2xsmall)) | layout |
| focus-ring | border-style | solid | no token yet |
| focus-ring | border-width | 2px | spacing/outline/medium |
| focus-ring | border-color | #b6ffda | actions/primary/focus/focus-ring |
| focus-ring | pointer-events | none | Figma frame size |
Changes by variant
description.color5
| state=Default | #999 | non-interactive/foreground/tertiary |
| state=Hover | #ededed | non-interactive/foreground/primary |
| state=Pressed | #ededed | non-interactive/foreground/primary |
| state=Focus | #999 | non-interactive/foreground/tertiary |
| state=Disabled | #3a3a3a | non-interactive/foreground/quadruple |
description.font-size5
| state=Default | 14px | typography/paragraph/font-size |
| state=Hover | 14px | typography/paragraph/font-size |
| state=Pressed | 16px | typography/body/font-size |
| state=Focus | 14px | typography/paragraph/font-size |
| state=Disabled | 14px | typography/paragraph/font-size |
description.font-weight1
| state=Pressed | 500 | typography/body/font-weight/medium |
description.line-height5
| state=Default | 20px | typography/paragraph/line-height |
| state=Hover | 20px | typography/paragraph/line-height |
| state=Pressed | 22px | typography/body/line-height |
| state=Focus | 20px | typography/paragraph/line-height |
| state=Disabled | 20px | typography/paragraph/line-height |
focus-ring.display1
| state=Focus | block | layout |
root.cursor1
| state=Disabled | default | Figma frame size |
title.color5
| state=Default | #ededed | non-interactive/foreground/primary |
| state=Hover | #ededed | non-interactive/foreground/primary |
| state=Pressed | #ededed | non-interactive/foreground/primary |
| state=Focus | #ededed | non-interactive/foreground/primary |
| state=Disabled | #3a3a3a | non-interactive/foreground/quadruple |