Duolith docs

Toolbar

A row of actions, such as IconButtons, with one Tab stop and the arrow keys to move between them.

Stability: experimental

Props

PropTypeDefaultMeans
labelstringWhat the actions are for, such as Formatting; the toolbar's accessible name.
flatbooleanfalseNo surface, border or padding, for a toolbar inside a bar or a card.

Children

The controls: IconButtons, Buttons or links.

States

StateLooks like
focusedThe focused control shows its own focus outline.
flatTransparent, with no border.

Accessibility

roletoolbar, named by label
nameThe label prop.
focusOne Tab stop: the control focused last, or the first usable one. Tab and Shift+Tab leave the toolbar.
keyboardArrowRight 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.
notesAny 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>