Rost

← All components

component

Breadcrumb

Where this page sits, from the top down. Links to the pages above it, a small chevron between, and this page's name last.

In code Contract: review Guidance: proposed Contract on GitHub Figma 742:29 As markdown
npx github:Runceanu/rost add breadcrumb

It lands in src/rost/breadcrumb/, with what it needs and its contract. Install has the rest.

When to use

  • Deep pages

    A page three or more levels down, like an invoice inside a client inside a year, so getting back up is one click.

When not to use

  • The main way around

    Moving between the top sections of an app. That's Navigation.

    Use Navigation

  • Steps

    Steps in a form, one after another. That's a stepper, and Rost doesn't have one yet.

Behaviour

Every page above this one is a link; this page is last and isn't. On a narrow screen the row wraps. I don't shorten long trails yet: if a trail is longer than four, it probably needs a different structure.

Accessibility

  • Element

    <nav aria-label="Breadcrumb"> around an <ol>, so it's a landmark and the order is a list.

  • Name

    Breadcrumb.

  • Keyboard

    Tab goes through the links, the way it does through any links.

  • Colour

    The links are 11:1 on the dark page, this page's name 14:1.

Content

Each page by the name it has on its own page, in sentence case.

Props

PropTypeValuesDefault
items slot

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

root

  • font-family 'General Sans Variable' font-family/base
  • font-weight 400 typography/paragraph/font-weight/regular
  • font-size 14px typography/paragraph/font-size
  • line-height 20px typography/paragraph/line-height
  • letter-spacing 0px typography/paragraph/letter-spacing

displayblock

list

  • gap 4px spacing/gap/2xsmall
  • padding 0px spacing/gap/none

displayflex · flex-wrapwrap · align-itemscenter · list-stylenone

item

  • gap 4px spacing/gap/2xsmall
  • color #d3d9d5 breadcrumb/link

displayinline-flex · align-itemscenter

separator

  • width 16px spacing/size/2xsmall
  • height 16px spacing/size/2xsmall
  • background #999999 breadcrumb/separator
  • mask url(./icon-chevron-right.svg) center / contain no-repeat on purpose: The icon file itself.

displayblock

current

  • color #ededed breadcrumb/current