Skip to main content

Breadcrumb

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

In Dense data

See it live​

Start Storybook to see it live: npm run storybook

When to use it​

In Dense data: On a record's own page, the way back to the list it came from. Not on the queue itself.

  • 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​

  • Lead with the object, then the state: "Alert 2041 contained."
  • Use numbers, not words for numbers.
  • One verb per button. No "please", no exclamation marks.
  • Use: Investigate, Filter, Assign, Escalated, Resolved. Avoid: Oops, Awesome, Please, Simply.

The labels components use, from the voice tokens:

  • content.action.commit: Save
  • content.action.cancel: Cancel
  • content.action.destroy: Delete
  • content.action.retry: Retry
  • content.action.empty-action: Change filters

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

Dense data 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.14:0.875rem
Text
Changes with theme
component.breadcrumb.list.labelcolor.text.mutedvar(--breadcrumb-list-label)Lightslate.light.600:#535D6DDarkslate.dark.400:#969FAD
Gap 2component.breadcrumb.list.gap-2component-spacing-map.x3var(--breadcrumb-list-gap-2)space.12:0.75rem
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)Lightslate.light.900:#161B23Darkslate.dark.900:#F7F8FA
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)Lightslate.light.900:#161B23Darkslate.dark.900:#F7F8FA
Breadcrumb
Icon sizecomponent.breadcrumb.icon-sizesize.iconvar(--breadcrumb-icon-size)size.16:1rem