useToolbar

Provides the behavior and accessibility implementation for a toolbar. A toolbar is a container for a set of interactive controls with arrow key navigation.

Example
Toolbar.tsx
Toolbar.css
Button.tsx
Button.css
import {Toolbar} from './Toolbar';
import {Button} from './Button';

<Toolbar aria-label="Actions">
  <Button variant="secondary">Copy</Button>
  <Button variant="secondary">Cut</Button>
  <Button variant="secondary">Paste</Button>
</Toolbar>

API

ToolbarGroupCutCutCutCutCutPasteCopyButtonCutCutCutCutGroupSeparator
<Toolbar>
  <Button />
  <ToggleButtonGroup>
    <ToggleButton />
  </ToggleButtonGroup>
  <Separator />
  <Group>
    <Button />
  </Group>
  <Select />
</Toolbar>
useToolbar(props: , ref: <HTMLElementnull>):

AriaToolbarProps

NameTypeDefault
orientationDefault: 'horizontal'

The orientation of the entire toolbar.

ToolbarAria

NameType
toolbarPropsHTMLAttributes<HTMLElement>

Props for the toolbar container.