Skip to main content

Breadcrumb

The trail of pages above this one, so people know where they are.

In Accessible first

See it live​

Start Storybook to see it live: npm run storybook

When to use it​

In Accessible first: Shows where a person is in the service.

  • Use it when: Deep structure where people may want to go up a level.
  • Not when: Steps of a task (progress), or the main navigation.

Instead:

  • Progress: Steps of a task, not where a page sits.
  • Pagination: Pages of a list, not levels.

Words​

  • Use common words. Explain any term you must use.
  • One idea per sentence. Put the action first.
  • Never blame the person.
  • Use: Continue, Change, Start, You. Avoid: Invalid, Utilise, Submit, Error code.

The labels components use, from the voice tokens:

  • content.action.commit: Continue
  • content.action.cancel: Go back
  • content.action.destroy: Delete
  • content.action.retry: Try again
  • content.action.empty-action: Start a new application

See Voice and tone for the whole voice.

Accessibility and keyboard​

Test before you ship:

  • It is a navigation landmark, and the current page is marked as current. undefined

Use it in code​

npx open-ds add breadcrumb

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

Tokens it reads​

Breadcrumb reads 9 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 Breadcrumb's tokens to change Breadcrumb alone.

Changes with theme

Accessible first 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.

PartIts token and the semantic it aliasesValue
List
Gapcomponent.breadcrumb.list.gapcomponent-spacing-map.x2var(--breadcrumb-list-gap)space.8:0.5rem
Text sizecomponent.breadcrumb.list.font-sizetype.body.font-sizevar(--breadcrumb-list-font-size)font.size.19:1.1875rem
Text
Changes with theme
component.breadcrumb.list.labelcolor.text.mutedvar(--breadcrumb-list-label)Lightgray.light.500:#595959Darkgray.dark.500:#949494
Gap 2component.breadcrumb.list.gap-2component-spacing-map.x3var(--breadcrumb-list-gap-2)space.20:1.25rem
Item
Gapcomponent.breadcrumb.item.gapcomponent-spacing-map.x2var(--breadcrumb-item-gap)space.8:0.5rem
Link
Label hover
Changes with theme
on hover
component.breadcrumb.link.label-hovercolor.text.primaryvar(--breadcrumb-link-label-hover)Lightgray.light.900:#141414Darkgray.dark.900:#F7F7F7
Page
Weightcomponent.breadcrumb.page.font-weighttype.body.font-weightvar(--breadcrumb-page-font-weight)font.weight.400:400
Text
Changes with theme
component.breadcrumb.page.labelcolor.text.primaryvar(--breadcrumb-page-label)Lightgray.light.900:#141414Darkgray.dark.900:#F7F7F7
Breadcrumb
Icon sizecomponent.breadcrumb.icon-sizesize.iconvar(--breadcrumb-icon-size)size.20:1.25rem