This documentation is under construction. Pages can be missing or change at any time. Follow it on GitHub.

Skip to content

Toolbar

A container for grouping a set of buttons and controls.

Examples#

Using with Menu#

All popup components that provide a Trigger component can be integrated with a toolbar: in a Toolbar, the trigger is an item of the toolbar, with the look of a ToolbarButton.

This applies to AlertDialog, Dialog, Menu, Popover, and Select.

Using with Tooltip#

A TooltipTrigger in a Toolbar is an item of the toolbar.

Using toggles with Tooltip#

A Toggle or a ToolbarButton in a Tooltip is a trigger of the tooltip: a toggle of a ToggleGroup keeps its group, and gets a tooltip.

Using with NumberField#

A NumberFieldInput in a Toolbar is an item of the toolbar, as a ToolbarInput.

API reference#

Import the components of the family:

use Phem\Ui\Toolbar;
use function Phem\Ui\{ToolbarButton, ToolbarLink, ToolbarInput, ToolbarGroup, ToolbarSeparator};

Toolbar#

A row of controls with one tab stop: Base UI Toolbar.Root, on the phem-toolbar controller. The arrow keys move the focus between the items. A Toggle, a ToggleGroup and a Select trigger in it are items and groups of the toolbar.

PropTypeDefault
orientation'horizontal' | 'vertical'Orientation::Horizontal
loopFocusbooltrue
disabledboolfalse
children?Htmlnull
...attrsarray[]

ToolbarSeparator#

A line between two groups of items of the toolbar.

PropTypeDefault
...restmixed—

ToolbarButton#

A button of the toolbar. With disabled, it stays in the focus order (aria-disabled).

PropTypeDefault
disabledboolfalse
children?Htmlnull
...restmixed—

A link in the toolbar. The arrow keys move the focus to it, as to the other items.

PropTypeDefault
href (required)string—
children?Htmlnull
...restmixed—

ToolbarInput#

A text field of the toolbar. The arrow keys move the caret until it is at an edge of the text.

PropTypeDefault
...restmixed—

ToolbarGroup#

A group of items. Give it an aria-label.

PropTypeDefault
disabledboolfalse
children?Htmlnull
...restmixed—

The source of the examples: examples/ui/Toolbar.phem.

Phem
Esc
↑↓ to navigate↵ to openEsc to close