WlSteps
Process steps. Completed steps have a check mark; the current step is highlighted.
Change props to see the result: the example and code use the same settings. “Reset” restores the initial values.
Settings
Enable step buttons and keyboard navigation, skipping disabled items.
Props items, current, orientation, models, handlers and slots can be edited in the SFC. See their descriptions in API.
Example
Step 2 of 3: Access.
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, 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.
Vue SFC · additional 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>