Skip to content

Toolbar

Arrow-key navigation across a group of commands. Custom element

Toolbar
Copy this markup
<ui-toolbar aria-label="Formatting">
<button class="ui-button" data-ui-variant="ghost" type="button">Bold</button>
<button class="ui-button" data-ui-variant="ghost" type="button">Italic</button>
<button class="ui-button" data-ui-variant="ghost" type="button">Underline</button>
<button class="ui-button" data-ui-variant="ghost" type="button" disabled>Comment</button>
</ui-toolbar>

Install

Styles and registration
import '@timelessui/components/css/tokens.css'
import '@timelessui/components/css/button.css'
import '@timelessui/components/css/toolbar.css'
import '@timelessui/components/define/ui-toolbar'

Anatomy

Parts are authored in your own markup and identified by the selector below, so your CSS can target the same anatomy without loading Timeless styles. Required parts must be present for the component to work. Private data-ui-internal-* hooks are written by the runtime and must never be authored.

PartRequiredSelectorPurpose
itemYesbutton, a, input, select, textareaAny focusable control in the toolbar. Timeless makes the group one tab stop and moves focus with the arrow keys.

Attributes

Every value below is implemented by the stylesheets this component ships. Boolean attributes are presence-based: author the attribute with no value, or omit it.

AttributeValuesDefaultDescription
orientationhorizontal · verticalhorizontalArrow-key axis across the toolbar controls.

Element API

Attributes above are the authoring surface. These are the DOM properties and events the registered element adds once it upgrades.

<ui-toolbar>

PropertyTypeNotes
orientation'horizontal' | 'vertical'Reflects the orientation attribute, documented above.

This element dispatches no component events.

Styling

Root identity: ui-toolbar. Required stylesheets: tokens.css, button.css, toolbar.css.

This component adds no custom properties of its own. Restyle it through the design tokens or your own CSS.

Design tokens this component reads (22)

These are global Atmosphere tokens. Change them once at the theme level rather than per component.

--ui-accent · --ui-bg-accent · --ui-bg-accent-active · --ui-bg-accent-hover · --ui-bg-control · --ui-bg-control-active · --ui-bg-control-hover · --ui-bg-control-muted · --ui-bg-danger · --ui-bg-danger-active · --ui-bg-danger-hover · --ui-duration-fast · --ui-ease-standard · --ui-fg · --ui-focus · --ui-radius-control · --ui-radius-md · --ui-shadow-control-accent · --ui-shadow-control-active · --ui-shadow-control-danger · --ui-shadow-outline-control · --ui-space-1

Accessibility

Keep the native elements, roles, and relationships shown in the example. Timeless adds only the state and keyboard coordination the platform does not already provide, and it never supplies your accessible names — those depend on your content.

Follows the Toolbar pattern from the ARIA Authoring Practices Guide.

KeyAction
Arrow keysMove focus to the previous or next control, following the orientation and skipping disabled ones.
Home / EndMove focus to the first or last enabled control.
Page Up / Page DownJump ten controls at a time.

The whole toolbar is one tab stop. Timeless manages roving tabindex so Tab moves past the group rather than through every control.

Before JavaScript runs

The markup above is complete and usable on its own: native controls submit, labels associate, and authored ARIA is already correct. Registration adds state synchronisation, focus management, and keyboard coordination on top of it.

More examples

Open Toolbar in StoryLite for variants, controls, and manual testing.