Skip to content
Menus & Navigation

Toolbar

An accessible button toolbar with roving focus and grouped controls.

Import

tsx
import { Toolbar, ToolbarButton, ToolbarSeparator, ToolbarGroup } from "@cronus-ui/ui";
bash
npx cronus-ui add toolbar

Examples

.cronus

The same component declared in Cronus. Emitted at build time from the audit fixtures — the kernel renders it as HTML with no React.

PortedParity: MatchGeometry 1/1Pixel diff 0 pxLogic 1/1Parity scoreboard
default.cronus
app "audit-fixtures" {
  port 5176
}

style {
  preset aurora
  theme dark
}

component ToolbarDefault layout:inline style:toolbar {
  aria-label:"Formatting"
  label "Formatting"
  text "Bold"
  text "Italic"
}

page "/audit/toolbar/default" type:custom {
  use ToolbarDefault
}

API Reference

Generated from the component's exported types.

ToolbarProps

Extends HTMLAttributes<HTMLDivElement>

Skip ToolbarProps props table
PropTypeDefaultDescription
orientation
"horizontal" | "vertical""horizontal"Layout orientation; also drives which arrow keys move focus.
className
string—Additional class names merged onto the root.
children
ReactNode—Contents of the component.
id
string—DOM id of the root element.

ToolbarButtonProps

Extends ButtonHTMLAttributes<HTMLButtonElement>

Skip ToolbarButtonProps props table
PropTypeDefaultDescription
pressed
boolean—Toggle-button pressed state; reflected as aria-pressed.
type
string—Native type of the underlying element.
disabled
boolean—Disables pointer and keyboard interaction.
onClick
(event: MouseEvent) => void—Click handler.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.

ToolbarSeparatorProps

Extends HTMLAttributes<HTMLDivElement>

Skip ToolbarSeparatorProps props table
PropTypeDefaultDescription
className
string—Additional class names merged onto the root.
children
ReactNode—Contents of the component.
id
string—DOM id of the root element.

ToolbarGroupProps

Extends HTMLAttributes<HTMLDivElement>

Skip ToolbarGroupProps props table
PropTypeDefaultDescription
className
string—Additional class names merged onto the root.
children
ReactNode—Contents of the component.
id
string—DOM id of the root element.