Toolbar
Groups controls into one tab stop with arrow-key navigation, like an editor toolbar.
Example
<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>import { Toolbar } from '@focsd-dev/react';
export function Example() { return <Toolbar label="Formatting">…</Toolbar>;}<script setup>import '@focsd-dev/components/focsd-toolbar.js';</script>
<template> <focsd-toolbar label="Formatting">…</focsd-toolbar></template>// Add CUSTOM_ELEMENTS_SCHEMA to the component's schemas, then:import '@focsd-dev/components/focsd-toolbar.js';
// template<focsd-toolbar label="Formatting">…</focsd-toolbar><script> import '@focsd-dev/components/focsd-toolbar.js';</script>
<focsd-toolbar label="Formatting">…</focsd-toolbar>API
Attributes
| Attribute | Property | Type | Default |
|---|---|---|---|
label | label | string | — |
orientation | orientation | 'horizontal' | 'vertical' | horizontal |
Slots
| Slot | Description |
|---|---|
(default) | Default content. |
CSS parts
Style the inside of the component with ::part(), for example focsd-toolbar::part(toolbar).
| Part | Description |
|---|---|
toolbar | The toolbar element. |
Accessibility
role="toolbar"witharia-labelandaria-orientation.- Roving tabindex: the toolbar is a single tab stop and arrow keys move between its controls.
Keyboard
| Key | Action |
|---|---|
| Arrow keys | Move between controls (by orientation) |
| Home / End | First / last control |
Ask the docs
Hi, what are you building?
Ask about any component, theming, forms or frameworks. I answer with the right component, a snippet and a link to its docs.