Navigation & menus
Layout
Stepper
A sequence of steps that shows progress and lets people move between them. Use it for checkouts, sign-up flows and setup wizards.
Install
import { Stepper } from 'vael-ui'Playground
Fruits
horizontal
Usage
<script setup lang="ts">
import { ref } from 'vue'
import { Stepper } from 'vael-ui'
const items = [
{ label: 'Apple', value: 'apple' },
{ label: 'Banana', value: 'banana' },
{ label: 'Cherry', value: 'cherry' },
]
const value = ref(0)
</script>
<template>
<Stepper :items="items" v-model="value" />
</template>Motion New
Stepper: its parts' appearance and their states, step by step. Each step, circle and line plays its own: current, completed or upcoming (a line is completed once it's filled).
<Stepper
:motion="{ states: { current: { root: { scale: 1.04 } } } }"
/>| Name | Type | Description |
|---|---|---|
initialexit | rootstepcircleconnectorcontent | Sets where each part comes in from and leaves to: any CSS property, plus x, y and blur. A plain number is px, or degrees for rotate. |
states | currentcompletedupcomingdisabledhoverfocus | Sets values per part that hold while a state is on. An array is a set of keyframes that plays once as the state turns on, such as a shake on invalid. |
enterleave | (parts, context) => animation | Animates the parts with GSAP, motion or element.animate(). Return the animation and the component waits for it, and stops it if interrupted. |
springdurationeasing | { damping, response } | number | string | Times all of it: a spring, or a duration in ms with an easing. Never both. |
false | boolean | Turns its motion off, for an animation of your own on its exposed elements. |
Accessibility
| Key | Action |
|---|---|
| TabShiftTab | Moves focus between the steps you can go to. |
| EnterSpace | Goes to the focused step. |
- Renders an
<ol>; the current step hasaria-current="step", and completed steps read “Completed” after their label. Connector lines arearia-hidden. - Steps are native buttons. With
linear, steps you haven’t reached aredisabledand can’t take focus. clickable: falserenders plain elements; if the row overflows, the list becomes a Tab stop so you can scroll it.