Components

Toolbar

Command strip with roving focus across buttons, links, inputs, groups, and separators.

Toolbar renders a role="toolbar" wrapper and an optional item array for common editor-style command strips. Generated commands use roving focus; text inputs keep native editing keys and a normal tab stop.

Anatomy

  • #default: Additional custom content inside the toolbar.
  • #[item.slot]: Per-item render override when an item has a slot key.

Toolbar root, groups, buttons, links, inputs, labels, and separators are generated from items.

Usage

Examples

Grouped commands

Use type: "group" for related commands inside the toolbar.

<template>
  <Toolbar
    :items="[
      { type: 'group', label: 'Alignment', children: [
        { label: 'Left', pressed: align === 'left', onSelect: () => (align = 'left') },
        { label: 'Center', pressed: align === 'center', onSelect: () => (align = 'center') },
      ] },
    ]"
  />
</template>

Custom item slot

Use slot on an item and render it with the matching named slot.

<template>
  <Toolbar :items="[{ label: 'Bold', slot: 'bold' }]">
    <template #bold="{ item }">
      <strong>{{ item.label }}</strong>
    </template>
  </Toolbar>
</template>

API Reference

Props

PropTypeDefaultDescription
itemsToolbarItem[][]Generated toolbar items.
orientation"horizontal" | "vertical""horizontal"Toolbar orientation.
loopbooleantrueArrow focus wraps.
disabledbooleanfalseDisables generated items.
ariaLabelstringAccessible label.
ariaLabelledbystringAccessible label id.
uiToolbarUiClasses for structural parts.

Emits

EventPayloadDescription
select(item, details)Fired before an item runs onSelect.
input-change(item, value, details)Fired before a generated input runs onUpdateValue.

Slots

SlotPropsDescription
defaultExtra toolbar content after generated items.
[item.slot]item, isDisabledCustom generated item content.

Item Shape

KeyTypeDescription
type"button" | "link" | "separator" | "group" | "input"Item type. Omit for button.
labelstringVisible label / accessible input label.
hrefstringLink target.
inputValuestring | numberControlled value for type: "input".
inputTypestringNative input type. Defaults to text.
namestringNative input name.
placeholderstringNative input placeholder.
min, max, stepnumber | stringNative numeric constraints.
disabledbooleanDisables item.
pressedbooleanSets aria-pressed and on/off state.
focusableWhenDisabledbooleanKeeps disabled item focusable.
childrenToolbarGroupItem[]Button commands inside a group. Nested groups and inputs are not supported.
slotstringNamed slot override.
onSelect() => voidRuns after uncanceled select event.
onUpdateValue(value: string) => voidRuns after uncanceled input change.

UI Options

KeyDescription
rootToolbar root.
groupGroup wrapper.
buttonGenerated button.
linkGenerated link.
inputGenerated input.
separatorSeparator.
labelDefault label span.

Styling Hooks

UI keyCSS classData attrs
rootakaza-toolbardata-akaza-orientation, data-akaza-disabled
groupakaza-toolbar-group
buttonakaza-toolbar-buttondata-akaza-state, data-akaza-disabled, data-akaza-toolbar-item
linkakaza-toolbar-linkdata-akaza-disabled, data-akaza-toolbar-item
inputakaza-toolbar-inputdata-akaza-disabled, data-akaza-toolbar-item
separatorakaza-toolbar-separatordata-akaza-orientation
labelakaza-toolbar-label

Keyboard

KeyBehavior
ArrowRight / ArrowLeftMove focus in horizontal toolbar.
ArrowDown / ArrowUpMove focus in vertical toolbar.
Home / EndMove to first/last focusable item.

Generated buttons and links use one roving tab stop. Text inputs remain native tab stops and keep Arrow/Home/End cursor behavior; toolbar navigation never hijacks their editing keys.