WlSteps

Process steps. Completed steps have a check mark; the current step is highlighted.
Components / Navigation v0.1.0

Selection

Step 2 of 3: Access.

Full example
<script setup lang="ts">
import { WlButton, type WlStepItem, WlSteps } from "legato-ui";
import { computed, ref } from "vue";
const current = ref(1);
const error = ref(true);
const items = computed<readonly WlStepItem[]>(() => [
  { key: "data", label: "Data", description: "Add the title and main details." },
  { key: "access", label: "Access", description: "Choose who can read the material.", error: error.value },
  { key: "review", label: "Review", description: "Review the result before saving." }
]);
</script>

<template>
  <div class="wl-stack" data-space="lg">
    <WlSteps
      v-model:current="current"
      :items="items"
      clickable
      aria-label="Material preparation steps"
      
    />
    <WlSteps
      v-model:current="current"
      :items="items"
      clickable
      orientation="vertical"
      aria-label="Material preparation, vertical layout"
    />
    <div class="wl-inline" data-space="sm">
      <WlButton size="sm" :disabled="current === 0" @click="current--">{{ "Previous step" }}</WlButton>
      <WlButton size="sm" :disabled="current === items.length - 1" @click="current++">{{ "Next step" }}</WlButton>
      <WlButton size="sm" variant="ghost" @click="error = !error">{{ "Toggle access error" }}</WlButton>
      <WlButton size="sm" variant="ghost" @click="current = 0; error = true">{{ "Start over" }}</WlButton>
    </div>
    <p class="wl-text-small" role="status">
      {{ "Step" }} {{ current + 1 }} {{ "of" }} {{ items.length }}: {{ items[current]?.label }}.
    </p>
  </div>
</template>

Completed, current and future steps

Clickable steps with controlled current state, descriptions, errors, horizontal/vertical keyboard navigation, back/next and restarting.

Step 2 of 3: Access.

Full example
<script setup lang="ts">
import { WlButton, type WlStepItem, WlSteps } from "legato-ui";
import { computed, ref } from "vue";
const current = ref(1);
const error = ref(true);
const items = computed<readonly WlStepItem[]>(() => [
  { key: "data", label: "Data", description: "Add the title and main details." },
  { key: "access", label: "Access", description: "Choose who can read the material.", error: error.value },
  { key: "review", label: "Review", description: "Review the result before saving." }
]);
</script>

<template>
  <div class="wl-stack" data-space="lg">
    <WlSteps
      v-model:current="current"
      :items="items"
      clickable
      aria-label="Material preparation steps"
    />
    <WlSteps
      v-model:current="current"
      :items="items"
      clickable
      orientation="vertical"
      aria-label="Material preparation, vertical layout"
    />
    <div class="wl-inline" data-space="sm">
      <WlButton size="sm" :disabled="current === 0" @click="current--">{{ "Previous step" }}</WlButton>
      <WlButton size="sm" :disabled="current === items.length - 1" @click="current++">{{ "Next step" }}</WlButton>
      <WlButton size="sm" variant="ghost" @click="error = !error">{{ "Toggle access error" }}</WlButton>
      <WlButton size="sm" variant="ghost" @click="current = 0; error = true">{{ "Start over" }}</WlButton>
    </div>
    <p class="wl-text-small" role="status">
      {{ "Step" }} {{ current + 1 }} {{ "of" }} {{ items.length }}: {{ items[current]?.label }}.
    </p>
  </div>
</template>