Skip to content

Navigation

IToolbar ​

A bar of controls sharing one Tab stop, with arrow keys moving between them.

Last action: —

Entries ​

Three kinds: a button, a link (give it an href), and '-' for a separator between groups. Each control is a ghost IButton.

ts
const items: ToolbarEntry[] = [
  { label: 'Undo', icon: UndoIcon, onSelect: undo },
  { label: 'Docs', icon: BookIcon, href: '/docs' },
  '-',
  { label: 'Delete', icon: TrashIcon, disabled: true },
]

Icon-only ​

iconOnly hides the label and squares the control, keeping the label as the control's accessible name.

Anything else goes in the slot ​

Entries cover buttons, links and separators. For a toggle group, a select or a search field, use the default slot. IToggleGroup brings its own arrow-key handling and nests inside without fighting the toolbar for the same keys.

Marks: Bold

Vertical ​

Bare ​

Drops the container so the controls sit directly on the page.

Props ​

PropTypeDefaultDescription
itemsToolbarEntry[][]Ignored when the default slot is used
orientation'horizontal' | 'vertical''horizontal'Also decides which arrow keys move focus
size'xs' | 'sm' | 'md' | 'lg' | 'xl''sm'
barebooleanfalseDrop the container
loopbooleanfalseWrap from the last control back to the first
ariaLabelstring—Names the bar
unstyledboolean—Skip built-in classes
ui{ root?, button?, separator? }—Per-element class overrides

ToolbarButtonOption ​

FieldTypeDescription
labelstring
iconIconLike
onSelect() => voidIgnored on a link
hrefstringRenders a link instead of a button
disabledboolean
iconOnlybooleanHide the label, keep it as the name
ariaLabelstringOverrides that name

Slots ​

SlotDescription
defaultReplaces the generated controls entirely

Accessibility ​

Give the bar a name with ariaLabel. It takes a single Tab stop, and arrow keys move between the controls along the axis orientation sets. Set loop to wrap around at the ends.