Vue Stepper is a lightweight, horizontal stepper component designed for Vue.js applications, facilitating the creation of multi-step forms or guided processes. The current stable version is 1.4.2. Its release cadence shows regular, albeit minor, updates primarily focused on adding new language translations, with core features evolving less frequently (e.g., reset functionality in 1.4.0, event improvements in 1.0.10, and behavior changes in 1.0.8). Key differentiators include its simplicity, event-driven nature for controlling navigation, the ability to use custom Vue components as step content, and configurable features like top-buttons and step persistence via `keep-alive`. It provides explicit events for navigation (e.g., `completed-step`, `active-step`, `stepper-finished`, `clicking-back`) and allows granular control over step progression using the `can-continue` event from within content components. The component also supports various locales for button texts.
npm install vue-stepperVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to integrate `vue-stepper` into a Vue 3 application using the Composition API. It shows component registration, defining steps with custom content components, and handling key events like `completed-step`, `stepper-finished`, `clicking-back`, and `reset` events.
Ensure all custom step components emit the `can-continue` event with `{ value: true }` when the step is ready for progression. For example: `this.$emit('can-continue', {value: true});`Verify that all `name` properties within your `steps` array are distinct strings.
Add `<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">` to your HTML head or import the Material Icons CSS into your main stylesheet.
Set the `:keep-alive="false"` prop on the `<HorizontalStepper>` component if you need step components to re-initialize when navigating between steps.
Ensure your custom step component emits `this.$emit('can-continue', {value: true})` (or `emit('can-continue', {value: true})` in Composition API) when the step's content is valid or ready to proceed.Include the Material Icons stylesheet in your HTML `<head>` or import it into your main CSS file. For example, add `<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">` to your `index.html` or equivalent.
Ensure your custom step components (e.g., `StepOne`, `StepTwo`) are correctly imported and available in the scope where `HorizontalStepper` is utilized, typically by importing them in your `<script setup>` block or listing them in the `components` option of your parent component.