Toolbar
A compact roving-focus group for equal-priority buttons, toggles, links and lightweight controls.
Purpose
Use Toolbar to group equal-priority actions and controls in one compact roving-focus region.
Command toolbar
Installation
With the Siteplane registry alias configured, add the component and import the installed source from your app.
CLI
pnpm dlx shadcn@4.16.1 add @siteplane/toolbarImport
import { Toolbar } from "@/components/ui/toolbar";
import { ToolbarButton, ToolbarGroup, ToolbarInput, ToolbarLink, ToolbarSeparator } from "@/components/ui/toolbar";
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
import { Select, SelectItem, SelectPopup, SelectTrigger, SelectValue } from "@/components/ui/select";
import { Tooltip, TooltipPopup, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip";Need the machine-readable source metadata? View registry JSON.
Usage
Use Toolbar to group compact commands for an editor, filter surface or utility row.
import { Button } from "@/components/ui/button";
import { Toolbar, ToolbarButton, ToolbarGroup, ToolbarInput, ToolbarSeparator } from "@/components/ui/toolbar";
export function Example() {
return (
<Toolbar>
<ToolbarGroup><ToolbarButton aria-label="Copy" render={<Button size="icon-sm" variant="ghost" />}>Copy</ToolbarButton></ToolbarGroup>
<ToolbarSeparator />
</Toolbar>
);
}Examples
Toolbar slots stay unstyled pass-throughs: compose them with Button, Toggle and Select via render while Base UI handles roving focus.
Grouped actions
Disabled
disabled on the root and its buttons; focusableWhenDisabled stays part of the Base UI contract.
Vertical
With toggles
Formatting toolbar
ToggleGroup, Select and Tooltip composed into one roving-focus toolbar.
With link
With input
API Reference
The reference lists the source-owned exports and props that are easy to miss in visual examples. Inherited Base UI props remain available unless the wrapper narrows them.
- Compose
Toolbar,ToolbarGroup,ToolbarButton,ToolbarLink,ToolbarInputandToolbarSeparator. Toolbaraccepts Base UI toolbar props includingorientation,loopFocusandfocusableWhenDisabled.- Compose
ToolbarButtonthroughrenderwith an existing Button, Toggle, Select or popup trigger instead of nesting interactive elements. - In a vertical Toolbar, the separator becomes horizontal through the native orientation contract; include it when groups need a real boundary.
Motion
Component motion uses the shared Siteplane motion contract. See the global motion guide for provider setup, tokens and reduced-motion behavior.
- Toolbar itself is static. Nested Button, Toggle, Select and Tooltip primitives retain their own native motion.
- No additional toolbar-level reduced-motion handling is required.
Accessibility
- Preserve Base UI roving focus and arrow-key navigation.
- Give icon-only actions an accessible name; a Tooltip supplements but does not replace the trigger name.
- Use inputs sparingly because arrow keys also have text-cursor meaning inside an input.
Implementation Guidance
- Use
renderto compose existing controls into toolbar items. - Match separator direction to the toolbar orientation and keep related actions in
ToolbarGroup. - Do not invent a parallel toolbar button visual contract.