Toolbar
An arrow-key-navigable set of document actions. Name the Toolbar. Disabled items remain arrow-key focusable but cannot activate. Set focusableWhenDisabled={false} to exclude them from navigation.
@neumorphism-ui/toolbarPreview
Installation
Installation: toolbar
npx shadcn@latest add @neumorphism-ui/toolbarThe CLI resolves npm dependencies, base tokens, utilities, and component source in order.
New to this Registry? Set up the namespace before continuing.
Usage
Import
Toolbar import code
"use client";
import * as React from "react";
import { Toolbar, ToolbarGroup, ToolbarButton, ToolbarSeparator } from "@/components/ui/toolbar";Example
Toolbar usage code
export default function Example() {
const [message, setMessage] = React.useState("");
return (<div className="grid gap-3"><Toolbar aria-label={"Document tools"}><ToolbarGroup><ToolbarButton onClick={() => setMessage("Undo")}>{"Undo"}</ToolbarButton><ToolbarButton disabled>{"Redo"}</ToolbarButton></ToolbarGroup><ToolbarSeparator /><ToolbarButton onClick={() => setMessage("Local example saved.")}>{"Save changes"}</ToolbarButton></Toolbar><p role="status" className="text-sm text-[var(--muted-foreground)]">{message}</p></div>);
}API Reference
| Component | Prop | Type | Default | Description |
|---|---|---|---|---|
Toolbar | orientation | "horizontal" | "vertical" | — | Set layout and keyboard-navigation orientation. |
Toolbar | loopFocus | boolean | — | Loop keyboard focus at the ends. |
ToolbarButton | disabled | boolean | — | Disable user interaction. |
Accessibility
- 01
Name the Toolbar. Disabled items remain arrow-key focusable but cannot activate. Set focusableWhenDisabled={false} to exclude them from navigation.
- 02
Preserve labels and visible focus when customizing render or className.