WlToolbar
Placement
Formatting applies to this text.
Arrows follow orientation; Home and End focus the first and last enabled actions. Text editing keys remain with inputs.
Full example
<script setup lang="ts">
import { WlButton, WlToolbar } from "legato-ui";
import { ref } from "vue";
const bold = ref(false);
const italic = ref(false);
</script>
<template>
<div class="wl-stack" data-space="md" data-review-example="WlToolbar">
<WlToolbar aria-label="Text formatting">
<WlButton size="sm" :aria-pressed="bold" @click="bold = !bold">{{ "Bold" }}</WlButton>
<WlButton size="sm" disabled>{{ "Underline (unavailable)" }}</WlButton>
<WlButton
size="sm"
:aria-pressed="italic"
@click="italic = !italic"
>{{ "Italic" }}</WlButton>
</WlToolbar>
<p :style="{ fontWeight: bold ? 'bold' : 'normal', fontStyle: italic ? 'italic' : 'normal' }">
{{ "Formatting applies to this text." }}
</p>
<WlButton size="sm" @click="bold = false; italic = false">{{ "Restore example" }}</WlButton>
<p class="wl-text-small">{{ "Arrows follow orientation; Home and End focus the first and last enabled actions. Text editing keys remain with inputs." }}</p>
</div>
</template>Related formatting actions
One keyboard stop for a labelled group of related actions.
Formatting applies to this text.
Arrows follow orientation; Home and End focus the first and last enabled actions. Text editing keys remain with inputs.
Full example
<script setup lang="ts">
import { WlButton, WlToolbar } from "legato-ui";
import { ref } from "vue";
const bold = ref(false);
const italic = ref(false);
</script>
<template>
<div class="wl-stack" data-space="md" data-review-example="WlToolbar">
<WlToolbar aria-label="Text formatting">
<WlButton size="sm" :aria-pressed="bold" @click="bold = !bold">{{ "Bold" }}</WlButton>
<WlButton size="sm" disabled>{{ "Underline (unavailable)" }}</WlButton>
<WlButton
size="sm"
:aria-pressed="italic"
@click="italic = !italic"
>{{ "Italic" }}</WlButton>
</WlToolbar>
<p :style="{ fontWeight: bold ? 'bold' : 'normal', fontStyle: italic ? 'italic' : 'normal' }">
{{ "Formatting applies to this text." }}
</p>
<WlButton size="sm" @click="bold = false; italic = false">{{ "Restore example" }}</WlButton>
<p class="wl-text-small">{{ "Arrows follow orientation; Home and End focus the first and last enabled actions. Text editing keys remain with inputs." }}</p>
</div>
</template>Props
Types, accepted values and literal defaults come from the public manifest. Inherited settings name their source; “Not set” means no default is declared.
| Prop | Type / values | Default | Purpose |
|---|---|---|---|
orientation | "horizontal" | | "horizontal" | Layout direction and applicable arrow-key navigation direction. |
loop | boolean | true | Wrap arrow-key focus navigation at the first and last items. |
variant | "default" | "default" | Visual treatment within this component family. |
size | WlSizeSm | "md" | Size within the component family's documented scale. |
density | WlDensity | "default" | Spacing density for this component family. |
disabled | boolean | false | Disable user interaction with this component. |
pt | WlPt< | Not set | Attributes and callbacks for the component's documented pass-through sections. |
Events
No public events.
Slots
| Slot | Type / values | Content |
|---|---|---|
default | default?(props: Record< | Toolbar controls participating in the shared arrow-key focus navigation. |
Pass-through: pt
Sections WlToolbar are listed below. Attributes merge in this order: createWlPt() WlConfig.ptpt instance. Class and style merge; the last supplied value takes priority for other attributes.
| Section | DOM | Purpose |
|---|---|---|
root | div.wl-toolbar | Main element of the component. |
Sections refer to the component DOM. Dotted names identify a configuration group and its section; composite parts use their own pt groups. Global and local attributes merge, with class and style added together.
Keyboard and accessibility
- Give the toolbar an accessible name and name every icon action.
- The toolbar keeps one enabled action in sequential focus; controls retain their native roles.
- Arrows follow orientation; Home and End focus the first and last enabled actions. Text editing keys remain with inputs.
Keyboard and application responsibilities
| Key | Action |
|---|---|
| Tab | Enter or leave the group through one active focus stop. |
| ← / → or ↑ / ↓ | Move in the configured orientation and skip disabled items. |
| Home / End | Focus the first or last enabled item. |
| Enter / Space | Activate the focused action. Tabs, radios and segmented choices select as documented. |
Provide a meaningful accessible name and connect labels, hints and errors to the focusable element. Check the behavior with your own data and a screen reader.
WAI-ARIA Authoring PracticesIn your application, check keyboard controls, zoom and focus visibility. State labels and required information must be readable in every theme.