Toolbar
A row of actions, such as IconButtons, with one Tab stop and the arrow keys to move between them.
Stability: experimental
Props
| Prop | Type | Default | Means |
|---|---|---|---|
label | string | What the actions are for, such as Formatting; the toolbar's accessible name. | |
flat | boolean | false | No surface, border or padding, for a toolbar inside a bar or a card. |
Children
The controls: IconButtons, Buttons or links.
States
| State | Looks like |
|---|---|
focused | The focused control shows its own focus outline. |
flat | Transparent, with no border. |
Accessibility
| role | toolbar, named by label |
| name | The label prop. |
| focus | One Tab stop: the control focused last, or the first usable one. Tab and Shift+Tab leave the toolbar. |
| keyboard | ArrowRight and ArrowDown move to the next control, ArrowLeft and ArrowUp to the previous, wrapping at the ends; Home and End go to the first and last. Disabled controls are skipped, and when the focused one becomes disabled focus moves to the new Tab stop. Moving never presses; Enter and Space do. Keys with Alt, Ctrl, Meta or Shift held, and the caret keys inside a text field, are left alone; a toolbar inside another handles its own keys. |
| notes | Any view with role="toolbar" gets this keyboard behaviour from the runtime, as a radio-group does. |
Theme tokens
color.surface color.border space.1 space.2 radius.lg
Example
<Toolbar label="Message actions">
<IconButton icon="send" label="Reply" onPress={reply} />
<IconButton icon="trash" label="Delete" onPress={remove} />
</Toolbar>