Skip to content

Early previewhamur is not on npm yet. The components are being built in the open, follow along on GitHub.

UIComponentsReact

Toolbar

A row of buttons, links and inputs that the arrow keys move between as one stop.

Built on the headless Toolbar.See its API in Docs

Rendered by React 19.3.1

toolbar.tsx

Installation

npx shadcn@4.23.0 add https://hamur.dev/r/react/toolbar.json

It also adds utils, button. The app needs its setup first: Installation.

Usage

Toolbar holds ToolbarButtons, ToolbarLinks and ToolbarInputs, grouped with ToolbarGroup and split by ToolbarSeparator. Buttons and links look like small ghost and link buttons; give the toolbar and each group an aria-label. Tab reaches the toolbar once and the arrow keys move inside it, from the headless Toolbar. A Toggle Group can sit in it for buttons that stay pressed.

import {
  Toolbar,
  ToolbarButton,
  ToolbarGroup,
  ToolbarInput,
  ToolbarLink,
  ToolbarSeparator,
} from '@/components/ui/toolbar'

Examples

Default

Two groups of formatting buttons and a link.

Its preview and code are at the top of the page.

shadcn/ui has no Toolbar, so this item takes Base UI's component ID as its slug and one name per Base UI part. Its buttons and links take Button's classes.

API reference

The styled parts pass every prop to the headless part they wrap and add classes. The props, data attributes and keyboard are on Toolbar's API reference.