Import
Basic Usage
Key Components
Toolbar.Root
A container for grouping a set of controls. Renders a<div> element.
Key Props:
orientation:'horizontal' | 'vertical'- The orientation of the toolbar (default:'horizontal')disabled:boolean- Whether the whole toolbar is disabled (default:false)loopFocus:boolean- Iftrue, keyboard navigation will wrap focus to the other end of the toolbar once the end is reached (default:true)
data-orientation:'horizontal' | 'vertical'- The orientation of the toolbardata-disabled: Present when the toolbar is disabled
Toolbar.Button
A button within the toolbar. Renders a<button> element.
Key Props:
disabled:boolean- Whether the button is disabled
data-disabled: Present when the button is disabled
Toolbar.Link
A link within the toolbar. Renders an<a> element.
Key Props:
href:string- The URL the link points to
Toolbar.Input
An input field within the toolbar. Renders an<input> element.
Key Props:
- Standard input props like
type,value,onChange, etc.
Toolbar.Group
Groups related toolbar items together. Renders a<div> element.
Toolbar.Separator
A visual separator between toolbar items. Renders a<div> element.
State:
data-orientation: Reflects the parent toolbar’s orientation
Features
- Keyboard navigation with arrow keys
- Support for horizontal and vertical orientations
- Grouping of related controls
- Visual separators
- Loop focus option
- Accessible ARIA attributes (
role="toolbar") - Support for buttons, links, and inputs