Rost
← All components
component

Menu

A navigation item: a label with a line underneath, used in the main nav.

In codeContract: reviewGuidance: agreedContract on GitHubFigma 41:259

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-expanded and controls the list.

Content

One word: the page's own title.

Props

PropTypeValuesDefault
titleslot
descriptionslot
showDescriptionbooleantrue
showDividerbooleantrue

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

PartPropertyValueToken
rootdisplayflexlayout
rootflex-directioncolumnlayout
rootalign-itemsflex-startlayout
rootpositionrelativelayout
rootgap24pxspacing/gap/large
rootpadding-top24pxspacing/gap/large
roottext-decorationnoneFigma frame size
rootcolorinheritFigma frame size
rootoutlinenoneFigma frame size
rootwidth324pxFigma frame size
contentdisplayflexlayout
contentflex-directioncolumnlayout
contentalign-itemsflex-startlayout
contentwidth100%layout
contentgap12pxspacing/gap/small-medium
contentfont-family'General Sans Variable'font-family/base
contentline-height22pxtypography/body/line-height
contentfont-size16pxtypography/body/font-size
contentletter-spacing0pxtypography/body/letter-spacing
titlewidth100%layout
titlefont-weight500typography/body/font-weight/medium
descriptionwidth100%layout
descriptionfont-weight400typography/body/font-weight/regular
dividerwidth100%layout
dividerflex-shrink0layout
focus-ringdisplaynonelayout
focus-ringpositionabsolutelayout
focus-ringinsetvar(--spacing-gap-medium-large) calc(-1 * var(--spacing-gap-2xsmall))layout
focus-ringborder-stylesolidno token yet
focus-ringborder-width2pxspacing/outline/medium
focus-ringborder-color#b6ffdaactions/primary/focus/focus-ring
focus-ringpointer-eventsnoneFigma frame size

Changes by variant

description.color5
state=Default#999non-interactive/foreground/tertiary
state=Hover#ededednon-interactive/foreground/primary
state=Pressed#ededednon-interactive/foreground/primary
state=Focus#999non-interactive/foreground/tertiary
state=Disabled#3a3a3anon-interactive/foreground/quadruple
description.font-size5
state=Default14pxtypography/paragraph/font-size
state=Hover14pxtypography/paragraph/font-size
state=Pressed16pxtypography/body/font-size
state=Focus14pxtypography/paragraph/font-size
state=Disabled14pxtypography/paragraph/font-size
description.font-weight1
state=Pressed500typography/body/font-weight/medium
description.line-height5
state=Default20pxtypography/paragraph/line-height
state=Hover20pxtypography/paragraph/line-height
state=Pressed22pxtypography/body/line-height
state=Focus20pxtypography/paragraph/line-height
state=Disabled20pxtypography/paragraph/line-height
focus-ring.display1
state=Focusblocklayout
root.cursor1
state=DisableddefaultFigma frame size
title.color5
state=Default#ededednon-interactive/foreground/primary
state=Hover#ededednon-interactive/foreground/primary
state=Pressed#ededednon-interactive/foreground/primary
state=Focus#ededednon-interactive/foreground/primary
state=Disabled#3a3a3anon-interactive/foreground/quadruple