Toolbar
A grouping container (role="toolbar") for a set of related controls, with the toolbar keyboard pattern.
Import
Section titled “Import”<script> import Toolbar from "@invisible-ui/svelte/Toolbar.svelte";</script><script setup> import { Toolbar } from "@invisible-ui/vue";</script>import { Toolbar } from "@invisible-ui/react";<script type="module"> import "@invisible-ui/elements/define";</script>
<ds-toolbar></ds-toolbar>In Elements:
<ds-toolbar label="Formatting"> <ds-button>Bold</ds-button> <ds-button>Italic</ds-button> <ds-separator orientation="vertical" decorative></ds-separator> <ds-button aria-label="Add" icon-only>+</ds-button></ds-toolbar>Controls added, removed or disabled later keep a single tab stop.
| Prop | Type | Default | Description |
|---|---|---|---|
label * | string | — | |
orientation | "horizontal" | "vertical" | "horizontal" | |
flat | boolean | false | Borderless presentation: the controls inside lose their individual border/fill at rest (they read as one group, divided only by separators) with a subtle hover overlay. |
| Prop | Type | Default | Description |
|---|---|---|---|
label * | string | — | Accessible name for the toolbar (required). |
orientation | ToolbarOrientation | "horizontal" | |
flat | boolean | false | Flat presentation: the controls inside lose their individual borders and fill at rest (they read as one group, divided only by separators), with a subtle hover overlay. The toolbar's own frame still groups them. |
Slots: default.
| Prop | Type | Default | Description |
|---|---|---|---|
label * | string | — | Accessible name for the toolbar (required). |
orientation | ToolbarOrientation | "horizontal" | |
flat | boolean | false | Flat presentation: the controls inside lose their individual borders and fill at rest (they read as one group, divided only by separators), with a subtle hover overlay. The toolbar's own frame still groups them. |
children | ReactNode | — | The controls: buttons, toggle buttons, separators. |
| Attribute | Reactive | Description |
|---|---|---|
label * | yes | |
orientation | yes | horizontal|vertical |
flat | yes |
Reactive attributes re-render the element when they change after the first render.
Accessibility
Section titled “Accessibility”role="toolbar"witharia-orientation; alabelis required.- Single tab stop (roving tabindex); arrow keys move between controls (Left/Right horizontal, Up/Down vertical), plus Home/End with wrapping.
- A control that needs a key keeps it: in a text input, Left/Right (Up/Down in a vertical toolbar) move the caret and Home/End go to the ends of the text, and a multi-line field keeps every arrow. Tab leaves the toolbar from a text input.
Example
Section titled “Example”<Toolbar label="Formatting"> <ToggleButton label="Bold">B</ToggleButton> <ToggleButton label="Italic">I</ToggleButton> <Separator orientation="vertical" decorative /> <Button ariaLabel="Add">+</Button></Toolbar>In React, the controls are the children. The toolbar finds them in the page, so any component that renders a button takes part:
<Toolbar label="Formatting"> <ToggleButton label="Bold">B</ToggleButton> <ToggleButton label="Italic">I</ToggleButton> <Separator orientation="vertical" decorative /> <Button ariaLabel="Add" iconOnly> + </Button></Toolbar>Themeable via --ds-toolbar-gap.