# 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.

| | |
|---|---|
| Kind | component |
| Contract | `review` · [toolbar.contract.yaml](https://github.com/Runceanu/rost/blob/master/contracts/toolbar.contract.yaml) |
| Guidance | `proposed` |
| Source | [Figma 746:135](https://www.figma.com/design/1Zy0wiWKXQAvsfDBX3KR0d/UI-Kit-v01?node-id=746-135) · read 2026-11-17 · frozen 2026-11-17 |
| Implemented in | nowhere yet |

## Install

It lands in `src/rost/toolbar/`, with what it needs and its contract:

```sh
npx github:Runceanu/rost add toolbar
```

Then import `src/rost/fonts.css` and `src/rost/tokens.css` once, at the root of the app. More on this in [Install](https://rost.build/docs/install.md).

## Props

| Prop | Type | Values | Default |
|---|---|---|---|
| `children` | slot |  |  |
| `label` | string |  |  |

## Anatomy

- `root`: A row, 4px between the buttons and 4px around them, on the secondary surface with an edge and 12px corners.
- `separator`: A 1px line, 24px tall, between two groups of buttons.

## 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

- **The page's main action.** Save or Send is a **Button** with words, not an icon in a strip.
- **Picking one of a few views.** When exactly one is on, that's a **ToggleGroup**.

## 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.

## Tokens

Every token this component uses, across all its variants.

| Token | Resolves to |
|---|---|
| `spacing/gap/2xsmall` | `4px` |
| `spacing/outline/small` | `1px` |
| `spacing/radius/medium` | `12px` |
| `spacing/size/small` | `24px` |
| `toolbar/background` | `#171717` |
| `toolbar/edge` | `#3a3a3a` |
| `toolbar/separator` | `#3a3a3a` |

## No token, on purpose

| Part | Property | Value | Why |
|---|---|---|---|
| `root` | `outline-offset` | `calc(-1 * var(--spacing-outline-small))` | Composed from a token: the edge sits inside. |

See it live, with every value of every variant: [rost.build/components/toolbar/](https://rost.build/components/toolbar/)
