Skip to content
Focsd homeFocsd homeFocsd
Forms

Toolbar

Groups controls into one tab stop with arrow-key navigation, like an editor toolbar.

  • Tag: focsd-toolbar
  • Pattern: Toolbar
  • Category: Actions

Example

Bold Italic Clear formatting
HTML
<focsd-toolbar label="Formatting">
<focsd-toggle>Bold</focsd-toggle>
<focsd-toggle>Italic</focsd-toggle>
<focsd-button>Clear formatting</focsd-button>
</focsd-toolbar>

Usage

Import the module once, then use the tag like any HTML element. Every framework below renders the same element; see Frameworks for setup.

<script type="module">
import '@focsd-dev/components/focsd-toolbar.js';
</script>
<focsd-toolbar label="Formatting">…</focsd-toolbar>

API

Attributes

AttributePropertyTypeDefault
labellabelstring—
orientationorientation'horizontal' | 'vertical'horizontal

Slots

SlotDescription
(default)Default content.

CSS parts

Style the inside of the component with ::part(), for example focsd-toolbar::part(toolbar).

PartDescription
toolbarThe toolbar element.

Accessibility

  • role="toolbar" with aria-label and aria-orientation.
  • Roving tabindex: the toolbar is a single tab stop and arrow keys move between its controls.

Keyboard

KeyAction
Arrow keysMove between controls (by orientation)
Home / EndFirst / last control