Components
Toolbar Grouped controls for rich editors and tool palettes with roving focus, toggle groups, links, and separators.
The components are exported from @by/experience-system . Add the package with your package manager:
pnpm add @by/experience-system
In this monorepo, depend on the workspace package (for example via workspace:* or your catalog) so imports resolve to packages/experience-system.
Build a Toolbar from ToolbarToggleGroup / ToolbarToggleItem , ToolbarButton , ToolbarLink , and ToolbarSeparator :
Toolbar
├── ToolbarToggleGroup
│ └── ToolbarToggleItem …
├── ToolbarSeparator (optional)
├── ToolbarButton | ToolbarLink …
└── …
Other primitives with asChild triggers (for example DropdownMenu ) can be composed inside the toolbar per Radix composition . See Radix Toolbar .
import {
Toolbar,
ToolbarButton,
ToolbarSeparator,
ToolbarToggleGroup,
ToolbarToggleItem,
} from '@by/experience-system' ;
All toolbar parts are client components ('use client'). Use them inside a Client Component or a dynamic import when using the Next.js App Router.
< Toolbar aria-label = "Actions" orientation = "horizontal" loop >
< ToolbarToggleGroup type = "single" defaultValue = "left" aria-label = "Align" >
< ToolbarToggleItem value = "left" aria-label = "Left" >
L
</ ToolbarToggleItem >
< ToolbarToggleItem value = "right" aria-label = "Right" >
R
</ ToolbarToggleItem >
</ ToolbarToggleGroup >
< ToolbarSeparator />
< ToolbarButton type = "button" >Save</ ToolbarButton >
</ Toolbar >
Multiple and single ToolbarToggleGroup regions, a ToolbarLink , and a ToolbarButton (same preview as at the top of the page).
Two groups only—style (multiple ) and alignment (single ).
ToolbarButton with ToolbarLink items for secondary navigation.
The tables below mirror the Radix UI Toolbar API . Subsection titles match @by/experience-system exports. ToolbarButton and ToolbarLink layer Button styles on Radix Toolbar.Button and Toolbar.Link .
Prop Type Default asChildbooleanfalseorientationhorizontal | verticalhorizontaldirltr | rtl— loopbooleantrue
Data attribute Values data-slottoolbardata-orientationhorizontal | vertical
Prop Type Default asChildbooleanfalsevariantButton variant valuesoutlinesizeButton size valuessmcolorButton color valuesneutral
Data attribute Values data-slottoolbar-buttondata-colormirrors color data-orientationhorizontal | vertical
Prop Type Default asChildbooleanfalsesizeButton size valuessm
Data attribute Values data-slottoolbar-linkdata-orientationhorizontal | vertical
Prop Type Default asChildbooleanfalse
Data attribute Values data-slottoolbar-separatordata-orientationhorizontal | vertical
Prop Type Default asChildbooleanfalsetypesingle | multiple— (required) valuestring or string[]— defaultValuestring or string[]— onValueChange(value: string | string[]) => void— disabledbooleanfalsevariantoutline | ghostghostsizesm | md | lgsm
Data attribute Values data-slottoolbar-toggle-groupdata-orientationhorizontal | vertical
Prop Type Default asChildbooleanfalsevaluestring— (required) disabledboolean— variantoutline | ghostFrom group context sizesm | md | lgFrom group context
Data attribute Values data-slottoolbar-toggle-itemdata-stateon | offdata-disabledPresent when disabled data-orientationhorizontal | vertical
Label the Toolbar and each ToolbarToggleGroup with aria-label (or aria-labelledby ). Icon-only ToolbarToggleItem values need aria-label . Radix uses roving tabindex across toolbar items. See Radix Toolbar — accessibility .
Key Description TabMoves focus into the toolbar (first item). SpaceActivates or toggles the focused item. EnterActivates or toggles the focused item. ArrowRight / ArrowDownMoves focus to the next item (depends on orientation ). ArrowLeft / ArrowUpMoves focus to the previous item. HomeMoves focus to the first item. EndMoves focus to the last item.
Source in the repo: packages/experience-system/src/components/Toolbar/Toolbar.tsx. Agent-oriented contracts: packages/experience-system/src/components/Toolbar/Toolbar.instructions.md.
Moving beyond interface boundaries helps humans solve more complex problems, more proactively. That changes how work gets done—and creates a better way to work and live.