Vue Form Wizard

0.8.4 · active · verified Sun Apr 19

Vue Form Wizard is a Vue.js component designed to simplify the creation and management of multi-step forms or tabbed interfaces, often referred to as 'wizards'. It provides a flexible, dependency-free solution for splitting complex forms into manageable steps, improving user experience by guiding them through a process. The current stable version is 0.8.4. While its release cadence isn't strictly defined, patches and minor updates have been released intermittently, suggesting an active maintenance approach. Key differentiators include its complete lack of external dependencies (beyond Vue itself), built-in support for features like keyboard navigation (WAI-ARIA), scoped slots for extensive customization, integration with validation libraries like Vuelidate, and handling of asynchronous step changes and validations. It supports both horizontal and vertical layouts and offers various event hooks for controlling step transitions.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates a basic multi-step form using `vue-form-wizard` with three tabs and data binding.

import { createApp } from 'vue';
import FormWizard from 'vue-form-wizard';
import 'vue-form-wizard/dist/vue-form-wizard.min.css';

const app = createApp({
  template: `
    <div id="app">
      <form-wizard @on-complete="onComplete" :start-index="0">
        <tab-content title="Personal details" icon="ti-user">
          <p>Step 1: Enter your personal information.</p>
          <input type="text" placeholder="Name" v-model="formData.name" />
        </tab-content>
        <tab-content title="Payment details" icon="ti-credit-card">
          <p>Step 2: Provide payment information.</p>
          <input type="text" placeholder="Card Number" v-model="formData.cardNumber" />
        </tab-content>
        <tab-content title="Last step" icon="ti-check">
          <p>Step 3: Review and submit.</p>
          <pre>{{ JSON.stringify(formData, null, 2) }}</pre>
        </tab-content>
      </form-wizard>
    </div>
  `,
  components: {
    FormWizard,
    TabContent: FormWizard.TabContent // Access TabContent via FormWizard
  },
  data() {
    return {
      formData: {
        name: '',
        cardNumber: ''
      }
    };
  },
  methods: {
    onComplete() {
      alert('Yay. Done!');
      console.log('Form completed with data:', this.formData);
    }
  }
});

app.mount('#app');

view raw JSON →