Skip to content
SevenUI
Sign in
On this page

Toolbar

A container for grouping a set of controls, such as buttons, toggle groups, or links, built on the Base UI Toolbar primitive.

Installation

Bash

Usage

API reference

Toolbar is a Base UI bonus primitive absent from shadcn/ui, like Meter and Number Field.

Toolbar

Extends the Base UI Toolbar Root — renders <div role="toolbar">. Arrow keys move roving focus across button, link, and input items (skipping disabled ones); Home/End jump to the first/last item.

PropTypeDefault
orientation"horizontal" | "vertical" — arrow-key axis"horizontal"
loopFocusboolean — wrap focus at the endstrue
disabledboolean — disables every itemfalse

ToolbarButton

Renders a native <button>, but — like Tabs.Tab and Accordion.Trigger — it passes focusableWhenDisabled: true internally: a disabled button stays focusable and receives aria-disabled="true" instead of the native disabled attribute, so it remains keyboard-reachable and tooltips still open on it. Style the disabled state with data-disabled:, not the disabled: Tailwind variant.

Render a native <a> and <input>. Use at most one input, placed last in the toolbar — arrow keys move focus between items, which conflicts with cursor movement inside a text field.

ToolbarGroup and ToolbarSeparator

ToolbarGroup groups related items — give it an aria-label. ToolbarSeparator’s orientation defaults to the opposite of the toolbar’s (a horizontal toolbar renders a vertical separator line); its data-orientation reflects the separator’s own orientation.

Composition

Popup triggers (AlertDialog, Dialog, Menu, Popover, Select) render inside ToolbarButton — <ToolbarButton render={<MenuTrigger />} />. Tooltip is inverted — <TooltipTrigger render={<ToolbarButton />} />. Toggle buttons render as <ToolbarButton render={<Toggle />} value="…" /> inside a Toggle Group, which owns the pressed state: give each button a value, set the initially pressed ones with defaultValue={[...]}, and add multiple for a multi-select group.

Was this page helpful?