Skip to contentKino
Skip to Content

Toolbar

Buttons, toggles, menus and a field in one row that Tab reaches once and the arrow keys move through.

npx shadcn add https://kinoui.com/r/toolbar.json
Share on

Examples

Invoices in local currency

Customers on the annual plan asked for invoices in their own currency. Finance agreed to show the converted total under the original, rounded to the cent, from the next billing cycle.

KW

Kenji Watanabe Can we round half up, as the bank does?

Default

A Toggle group, a group of buttons, a toggle, a menu and a field in one row. Each looks and moves as it does on its own.

KN-482
Address autocomplete on the shipping step
AO
KN-479
Apple Pay sheet closes on rotation
KW
KN-471
Guest checkout copy
LF

With menus

A menu’s trigger renders a ToolbarButton, so it joins the arrow keys. Escape closes the menu and puts focus back on it.

Select tool

Vertical

orientation="vertical" stacks the items, and the up and down arrows move between them. Give a Toggle group inside the same orientation.

Disabled and loading

A disabled button stays in the arrow keys’ path, so it can be found and read out. A loading button shows its spinner as a Button does.

Installation

npx shadcn@latest add https://kinoui.com/r/toolbar.json
Files
lib/refs.tslib/reduce-motion.tslib/resize.tslib/swap.tsxcomponents/kino/spinner.tsxcomponents/kino/button.tsxlib/run-progress.tslib/highlight.tscomponents/kino/button-group.tsxlib/flow.tscomponents/kino/input.tsxcomponents/kino/separator.tsxcomponents/kino/toggle.tsxcomponents/kino/toolbar.tsx
Packages
@base-ui/reactclass-variance-authority

New to Kino? Installation covers what your project needs first and the @kino namespace.

API reference

Toolbar

PropTypeDefaultDescription
orientation'horizontal''vertical''horizontal'A row or a column, and which arrow keys move between items.
loopFocusbooleantrueThe arrow keys go from the last item back to the first.
disabledbooleanfalseDisables every button, toggle and field. A link stays live: there is no such thing as a disabled link.

ToolbarButton

PropTypeDefaultDescription
variant'outline''default''secondary''ghost''destructive''link''outline'As a Button’s. Outline, so it matches a Toggle group beside it.
size'xs''sm''default''lg''icon-xs''icon-sm''icon''icon-lg''default'As a Button’s. An icon size is square: name it with aria-label.
disabledbooleanfalseBlocks presses. It stays focusable unless focusableWhenDisabled is false.

ToolbarToggle

PropTypeDefaultDescription
pressedbooleanNoneWhether it is pressed, when you own the state. defaultPressed when you don’t.
onPressedChange(pressed: boolean) => voidNoneCalled when it is pressed or released.
variant'outline''default''outline'How it looks while not pressed.

ToolbarGroup

PropTypeDefaultDescription
disabledbooleanfalseDisables every item in the group.

Data attributes

AttributeOnDescription
data-orientationToolbar and its itemsThe toolbar’s orientation; on a separator, its own, across the toolbar.
data-disabledToolbar and its itemsPresent while it is disabled.
data-focusableToolbarButton, ToolbarInputPresent on a disabled item that can still take focus.

Accessibility

  • The row has role="toolbar": name it with aria-label. A vertical one has aria-orientation="vertical".
  • Tab reaches the toolbar once; the arrow keys move between its items, and the next Tab leaves it.
  • A disabled button, toggle or field stays focusable, with aria-disabled, so it can be found and read out. A Toggle group’s disabled items leave the arrow keys’ path, as Base UI’s toggles do in any group.
  • An icon-only item needs an aria-label, and a tooltip that shows it.