Skip to main content
A container for grouping a set of controls such as buttons, toggle groups, or menus. Toolbars provide a convenient way to organize related actions and maintain keyboard navigation between controls.

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 - If true, keyboard navigation will wrap focus to the other end of the toolbar once the end is reached (default: true)
State:
  • data-orientation: 'horizontal' | 'vertical' - The orientation of the toolbar
  • data-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
State:
  • data-disabled: Present when the button is disabled
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

Styling Example

Common Patterns

Text Editor Toolbar

Vertical Toolbar

With Input Fields

Disabled Toolbar

Application Toolbar