Rost

← All components

component

Toolbar

A row of IconButtons that act on one thing, on a raised strip, with thin lines between the groups. The arrow keys move between them.

In code Contract: review Guidance: proposed Contract on GitHub Figma 746:135 As markdown
Default

Install

npx github:Runceanu/rost add toolbar

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

When to use

  • Tools for one thing

    Over a preview, an editor or a document: back and forward, desktop or phone, zoom.

When not to use

Behaviour

Tab lands on one button and leaves the Toolbar on the next press. Left and right move between the buttons, Home and End jump to the ends. Each button does its own thing.

Accessibility

  • Element

    role="toolbar" with an aria-label. Only one button is in the tab order at a time. The separators are role="separator", upright.

  • Name

    The label prop. Each IconButton has its own.

  • Colour

    The edge is drawing, not information. The icons are the IconButtons' own.

Props

PropTypeValuesDefault
children slot
label string

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

  • gap 4px spacing/gap/2xsmall
  • padding 4px spacing/gap/2xsmall
  • border-radius 12px spacing/radius/medium
  • background #171717 toolbar/background
  • outline-width 1px spacing/outline/small
  • outline-offset calc(-1 * var(--spacing-outline-small)) on purpose: Composed from a token: the edge sits inside.
  • outline-color #3a3a3a toolbar/edge

displayinline-flex · align-itemscenter · outline-stylesolid

separator

  • width 1px spacing/outline/small
  • height 24px spacing/size/small
  • background #3a3a3a toolbar/separator

displayblock · flex-shrink0