Toolbar
A toolbar component that provides a container for grouping a set of controls, such as buttons or toggles, with proper keyboard navigation and ARIA support. Built on top of bits-ui's Toolbar for accessibility.
Import
import Toolbar from "$lib/components/Toolbar.svelte"; Basic Usage
A toolbar with text formatting controls and an AI button.
Properties
Name
Type
Description
className
Type
string
Default: ""
Additional classes to apply to the toolbar.
groups
Type
Array<ToolbarGroup>
Default: []
Array of toolbar groups with items that can be toggled.
buttons
Type
Array<ToolbarButton>
Default: []
Array of toolbar buttons to display.
Group Properties
Name
Type
Description
type
Type
"single" | "multiple"
Default: "single"
Whether the group allows single or multiple selection.
value
Type
string | string[]
Default: -
The selected value(s) in the group.
items
Type
Array<ToolbarItem>
Default: []
Array of items in the group.
Item Properties
Name
Type
Description
label
Type
string
Default: -
Accessible label for the item.
value
Type
string
Default: -
Value of the item when selected.
icon
Type
string
Default: -
Name of the icon to display (without .svg extension).
Button Properties
Name
Type
Description
label
Type
string
Default: -
Text label for the button.
icon
Type
string
Default: -
Optional icon to display (without .svg extension).
onClick
Type
() => void
Default: -
Click handler for the button.