Toolbar
A horizontal action bar with named slots for search, filters, and action buttons. Supports sticky positioning, density variants, and flexible alignment.
Basic Usage
Three-Zone Layout
Use named slots for structured toolbar regions:
Sticky
Pin the toolbar to the top of a scrollable container. The preview wraps the toolbar plus a tall body in an overflow-scrolling box so the sticky behavior is observable without scrolling the outer page — scroll inside the box to watch the toolbar stay anchored at the top.
A field that takes the focus inside the container, or a fragment link's target, comes to rest below the sticky toolbar rather than under it (keeping the focus clear of a pinned bar).
Density Variants
Alignment
Props
| Prop | Type | Default | Description |
|---|---|---|---|
sticky |
bool |
false |
Pin to top of scroll container |
density |
string |
'comfortable' |
Padding density: comfortable or compact |
align |
string |
'between' |
Content alignment: between, start, end |
aria-label |
string |
null |
Accessible label for the toolbar |
scope |
string|null | null |
Scoped personalization name |
Slots
| Slot | Description |
|---|---|
leading |
Left region (search, primary controls) |
filters |
Center region (filter chips, badges) |
trailing |
Right region (action buttons) |
| default | Falls back to trailing region |
Accessibility
role="group"on the root element — a related set of controls, each reached withTab- Pass
aria-labelso the group is announced with a purpose rather than as an unnamed one - Responsive: wraps on narrow viewports via
flex-wrap
Keyboard Interaction
This component is a layout wrapper. Keyboard interaction is delegated to its children: Tab moves to each control in turn, and every control keeps the keys it already handles.
It deliberately does not render role="toolbar". That role is a promise about the keyboard — one tab stop for the whole bar, arrow keys moving between the controls inside it, Home / End to the ends — and this component binds no keys, so the promise would be one it cannot keep. It also could not keep it in general: the leading slot is meant for a search field, where Left / Right belong to the text.
When you want that model, reach for a component that owns its own controls and can implement it — the editor's command bar is one.
Pitfalls
- Don't reach for this when you need arrow-key navigation between the controls. It is chrome: it lays the controls out and names the group. Nothing here changes how any of them is reached.
Design Tokens
The Toolbar is a layout primitive — it composes its inner controls (search inputs, buttons, badges) and inherits their tokens. Only the wrapper itself reaches for tokens directly:
| Token | Used for |
|---|---|
--font-wk-sans |
Toolbar font family |
--color-wk-bg |
Toolbar background |