Canvas Toolbar
betaA Figma-style tool rail: one active tool with a springy fill, a shape slot that swaps its tool from a flyout, and single-key shortcuts.
- Navigation
- 1 file
- 2 npm packages
- Accessibility notes
pnpm dlx @dowel-ui/cli add canvas-toolbarnpm packages installed: class-variance-authority, radix-ui.
import { CanvasToolbar } from "@/components/ui/canvas-toolbar";Default
Gallery
Shape Flyout
Global Shortcuts
Vertical
Right To Left
<CanvasToolbar>
| Prop | Type | Default |
|---|---|---|
tools (required)Tools, dividers and swappable slots, in order. | CanvasToolbarItem[] | — |
cornerRadius of the rail and flyout in px; tools use | number | 14 |
defaultValueThe initially active tool. Defaults to the first tool. | string | — |
flyoutClassNameExtra classes for the flyout panel. | string | — |
globalShortcutsListen for shortcuts on the whole document, not only while focus is in the toolbar. Keys typed into inputs, textareas and contenteditable are ignored. | boolean | false |
onValueChange | (value: string) => void | — |
sideWhich side the flyout and tooltips open on. Defaults to top (or the inline end when vertical). | Side | — |
stroke | boolean | — |
tone | "default" | "inverted" | "default" |
tooltipsShow each tool's name (and shortcut) in a tooltip. | boolean | true |
valueThe active tool (controlled). | string | — |
Every prop of Radix UI’s Toolbar.Root, plus className.
8/8
checks passed
- Tested — passes
- axe assertion — passes
- Keyboard tested — does not apply
- Storybook examples — passes
- Accessibility documented — passes
- Semantic tokens only — passes
- Motion from tokens — passes
- className merged — passes
- Visible focus — does not apply
- No fixed widths — passes