structyl

Toolbar API

View component

The full prop reference for the Toolbar component. A container for grouping a set of controls.

Import

tsx
import { Toolbar } from '@structyl/styled';

Props

Root

Container for toolbar components with focus management and keyboard navigation. Renders as a div with role="toolbar".

PropTypeDefault
asChild#boolean

When true, renders the component's children as the root element instead of rendering its own div.

orientation#'horizontal' | 'vertical'

Defines whether the toolbar items are arranged horizontally or vertically.

'horizontal'
dir#'ltr' | 'rtl'

Sets the reading direction. Auto-detected from useDirection hook if not provided.

loop#boolean

When true, focus loops from the last to the first element and vice versa.

true
className#string

CSS class name applied to the root element. Styled version applies default toolbar styles.

...rest#React.ComponentPropsWithoutRef<'div'>

All standard HTML div attributes (id, aria-label, data-*, etc.) are supported.

Button

A button element in the toolbar with roving focus and keyboard navigation support.

PropTypeDefault
disabled#boolean

When true, disables the button and removes it from the roving focus group.

className#string

CSS class name applied to the button element. Styled version applies default button styles.

...rest#React.ComponentPropsWithoutRef<'button'>

All standard HTML button attributes (type, onClick, title, aria-*, data-*, etc.) are supported.

Separator

A visual separator element in the toolbar. Automatically adapts its orientation (vertical for horizontal toolbars, horizontal for vertical toolbars).

PropTypeDefault
className#string

CSS class name applied to the separator element. Styled version applies default separator styles.

...rest#React.ComponentPropsWithoutRef<'div'>

All standard HTML div attributes (aria-*, data-*, etc.) are supported. The role is set to 'separator' automatically.

Source code

If you didn't find what you need here, read the component implementation .

structyl — Accessible React Component Library