WlToolbar

One keyboard stop for a labelled group of related actions.
Components / Navigation v1.0.0-rc.1

Change props to see the result: the example and code use the same settings. “Reset” restores the initial values.

Settings

Wrap arrow-key focus navigation at the first and last items.

Disable user interaction with this component.

Props orientation, variant, size, density, pt, models, handlers and slots can be edited in the SFC. See their descriptions in API.

Example

Formatting applies to this text.

Arrows follow orientation; Home and End focus the first and last enabled actions. Text editing keys remain with inputs.

Focus: outside the example · pointer: outside the example

Explore the live example and copy its Vue SFC into your application. Settings on the left can be combined.

Code for your application

Vue SFC · current settings
<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.

Vue SFC · additional 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>