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.
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>
| Prop | Type | Default | Description |
|---|---|---|---|
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>
| Prop | Type | Default | Description |
|---|---|---|---|
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>
| Prop | Type | Default | Description |
|---|---|---|---|
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>
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | — | Additional class names merged onto the root. |
children | ReactNode | — | Contents of the component. |
id | string | — | DOM id of the root element. |