Components
Toolbar
One Tab stop for a row of buttons, links and toggles; arrow keys move between them, and items that do not fit move into a More menu.
Ombelle · light
Toolbar
Installation
Run in a project initialized with an Ombelle preset (see Get started). The component uses the saved project preset. Run the command from your app folder; it shows the changes and asks before writing.
pnpm dlx @ombelle-ui/cli@1.1.2 add toolbarAdds components/ui/toolbar.tsx and installs react, @radix-ui/react-dropdown-menu, @radix-ui/react-toolbar, clsx, tailwind-merge, lucide-react with lifecycle scripts disabled. This is a client component.
In a liquid glass project the plan adds a notice that accessibility is not guaranteed, because text contrast depends on the background behind the glass.
Usage
example.tsx
import { Toolbar, ToolbarButton, ToolbarLink, ToolbarOverflow, ToolbarSeparator, ToolbarToggleGroup, ToolbarToggleItem } from '@/components/ui/toolbar'
export function Example(){return <Toolbar aria-label="View options"><ToolbarToggleGroup type="single" defaultValue="light" aria-label="Theme"><ToolbarToggleItem value="light">Light</ToolbarToggleItem><ToolbarToggleItem value="dark">Dark</ToolbarToggleItem></ToolbarToggleGroup><ToolbarSeparator /><ToolbarToggleGroup type="multiple" aria-label="Guides"><ToolbarToggleItem value="grid">Grid</ToolbarToggleItem></ToolbarToggleGroup><ToolbarLink href="#preview">Open preview</ToolbarLink><ToolbarOverflow /></Toolbar>}API and states
- API
- Toolbar (orientation, loop), ToolbarButton, ToolbarLink, ToolbarToggleGroup (type single or multiple, value, defaultValue, onValueChange), ToolbarToggleItem, ToolbarSeparator, ToolbarOverflow (label), ToolbarOverflowItem (onSelect, destructive)
- Minimum states
- Default, pressed, focus, disabled, overflowing, menu open
- Native basis
- Reviewed Radix Toolbar and Dropdown Menu; Base UI Toolbar, Toggle Group and Menu in the Base UI edition
- Styles
- Stable in Ombelle, Papier, Organic, Retro futurism, minimalist, neo-brutalism and flat, light and dark. Liquid glass: stable, accessibility not guaranteed.