Skip to content
Components / Controls

Toolbar

One tab stop for a row of controls: Tab enters and leaves once, the arrows, Home and End move between the buttons.

@fabrials/ui
Loading state

Installation

  1. Import the control from @fabrials/ui, after setting the app up.

    TypeScript
    import { Toolbar, ToolbarGroup, ToolbarSeparator, ToolbarButton } from "@fabrials/ui";

API reference

Prop / exportTypeDescription
Toolbar aria-labelstringRequired: the toolbar is announced by its name. ToolbarGroup needs one too.
Toolbar variant / sticky / containplain | bar / boolean / booleanbar is the page background between two hairlines, aligned to the page gutter, and measures its own width; sticky keeps it under the top of its scroll container.
Toolbar orientation / loopFocushorizontal | vertical / booleanArrow keys follow the orientation; focus wraps unless loopFocus is false.
ToolbarButton labelstringThe name, as a text node inside the button. Hidden until reveal shows it.
ToolbarButton revealearly | middle | lateShows the label from a toolbar width of 40rem, 52rem or 76rem.
ToolbarButton tierhigh | low | overflowlow is hidden below 34rem and folds into a menu; overflow is that menu's trigger and only shows below 34rem. Hidden items leave the arrow-key order.
ToolbarButton tooltip / shortcutboolean | ReactNode / string | string[] | { keys, sequence? }As IconButton, including the sequence form.

Behavior

Buttons stay in the arrow order when disabled (aria-disabled, no click) so neighbours never shift under a person who is arrowing. A native text field or select inside a toolbar adds a tab stop of its own; put it next to the toolbar. Before hydration the buttons are click targets only.

Accessibility

Keyboard and contrast
Keep visible labels, keyboard focus and status announcements when customizing. These components inherit your theme; maintain sufficient contrast in both color modes. The preview is keyboard operable.