Skip to main content
Copy for LLM

Toolbar

A horizontal action bar with named slots for search, filters, and action buttons. Supports sticky positioning, density variants, and flexible alignment.

Basic Usage

Simple toolbar

Three-Zone Layout

Use named slots for structured toolbar regions:

Leading + filters + trailing
Active Archived

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

Sticky toolbar pinned at top of scrollable container

Scroll this panel — the toolbar above stays pinned to the top while the body below scrolls. The sticky-pin uses native CSS position: sticky against the nearest scrolling ancestor (this overflow:auto wrapper), so no JS scroll listener is needed and the behavior holds at any viewport.

For the sticky to work the toolbar's parent must be either a scrolling container (this wrapper) or the document root. Mounting a sticky toolbar inside a parent with overflow: hidden or a flex layout that constrains height will pin it against the wrong ancestor — opt out by setting :sticky="false" when the toolbar lives inside a non-scrolling card.

Filler content to demonstrate the scroll. Each paragraph adds vertical real estate that pushes the bottom of the panel beyond the visible viewport. The toolbar tracks the top boundary as the reader scrolls.

Use sticky toolbars for primary actions in long-form admin panels (Save / Discard for an edit screen, Filter / Sort for a long results list, Compose / Reply for a mail thread). Avoid for read-only contexts where the toolbar's affordances are unrelated to the body content.

Combine with density="compact" to minimize the height the sticky toolbar reserves at the top of the scrollable region — useful when vertical space is tight.

The sticky pin respects the container's top offset, so if the scrolling ancestor itself has padding-top, the toolbar pins below the padding rather than against the raw scroll edge.

More filler. The sticky should now be visibly anchored. Scroll back to the top to see the toolbar return to its document-flow position; the pinning is purely a scroll-position behavior, not a layout shift.

End of the scrollable body. The toolbar above is the last thing you see at the top regardless of how far down you scroll.

Density Variants

Compact vs comfortable density

Alignment

Alignment variants

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 with Tab
  • Pass aria-label so 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

For control-level tokens see Input, Button, and Badge.

Updated in WireKit v2.64.0 (2026-10-04)

Was this page helpful?

Thank you for your feedback!

Voting requires cookies or local storage. What we store