Toolbar

Mixed-control rail on bits-ui Toolbar. Proper role=toolbar semantics with roving tabindex — arrow keys walk between children, separators are skipped, disabled items get skipped, Home/End jump to the ends.

Usage

Mixed content

Toolbar groups toggle groups, buttons, links, and separators in one focus ring. Arrow keys move between items; separators are skipped.

Vertical

Set orientation="vertical" to stack items. Up/Down arrows walk the toolbar instead of Left/Right.

With dropdown menu

Compose a DropdownMenu trigger inside Toolbar.Button via the child-snippet pattern for overflow actions.

Toolbar.Root props

Inherits bits-ui Toolbar.Root props via spread. Sets role=toolbar on the rendered div.

PropTypeDescription
'horizontal' | 'vertical'Axis of roving focus. Horizontal uses Left/Right arrows; vertical uses Up/Down.
booleanWhether arrow navigation wraps at the ends.
stringRequired. Names the toolbar landmark for assistive tech.
stringMerged onto the root via tailwind-merge.

Toolbar.Group props

Toggle group scoped inside a toolbar. type is required.

PropTypeDescription
'single' | 'multiple'Single picks one value at a time; multiple lets users stack toggles.
string | string[] (bindable)String for single, array for multiple. Two-way bindable.
booleanDisables every toggle in the group.

Toolbar.Toggle props

A GroupItem inside a Toolbar.Group. Inherits the Toggle primitive's styling via `variant` + `size`.

PropTypeDescription
stringRequired. Identifies the toggle within its group.
'default' | 'outline'Inherited from Toggle. Outline keeps a border in the resting state.
'sm' | 'default' | 'lg'Toolbar toggles default to sm so they tuck into the rail height.

Toolbar.Button props

Generic toolbar button. Inherits Button's variant/size.

PropTypeDescription
'default' | 'outline' | 'secondary' | 'ghost' | 'destructive' | 'link'Visual style, inherited from Button.
'xs' | 'sm' | 'default' | 'lg' | 'icon' | 'icon-xs' | 'icon-sm' | 'icon-lg'Toolbar buttons default to sm.