third_party/aria-practices/src/content/patterns/toolbar/toolbar-pattern.html
A toolbar is a container for grouping a set of controls, such as buttons, menubuttons, or checkboxes.
When a set of controls is visually presented as a group, the toolbar role can be used to communicate the presence and purpose of the grouping to screen reader users. Grouping controls into toolbars can also be an effective way of reducing the number of tab stops in the keyboard interface.
To optimize the benefit of toolbar widgets:
Implement focus management so the keyboard tab sequence includes one stop for the toolbar and arrow keys move focus among the controls in the toolbar.
Avoid including controls whose operation requires the pair of arrow keys used for toolbar navigation. If unavoidable, include only one such control and make it the last element in the toolbar. For example, in a horizontal toolbar, a textbox could be included as the last element.
Use toolbar as a grouping element only if the group contains 3 or more controls.
Toolbar Example: A toolbar that uses roving tabindex to manage focus and contains several types of controls, including toggle buttons, radio buttons, a menu button, a spin button, a checkbox, and a link.
Tab and Shift + Tab: Move focus into and out of the toolbar. When focus moves into a toolbar:
For a horizontal toolbar (the default):
Home (Optional): Moves focus to first element.
End (Optional): Moves focus to last element.
If the items in a toolbar are arranged vertically:
Down Arrow performs as Right Arrow is described above.
Up Arrow performs as Left Arrow is described above.
Typically, disabled elements are not focusable when navigating with a keyboard. However, in circumstances where discoverability of a function is crucial, it may be helpful if disabled controls are focusable so screen reader users are more likely to be aware of their presence. For additional guidance, see Focusability of disabled controls.
In applications where quick access to a toolbar is important, such as accessing an editor's toolbar from its text area, a documented shortcut key for moving focus from the relevant context to its corresponding toolbar is recommended.
vertical. The default orientation is horizontal.