Convert Figma logo to code with AI

BinarCode logovue-form-wizard

Vue.js 2 wizard

1,114
244
1,114
124

Top Related Projects

Tiny (<2k gzipped) and dependency free mask input for Vue.js

✅ Painless Vue forms

Simple, lightweight model-based validation for Vue.js

:clipboard: A schema-based form generator component for Vue.js

Quick Overview

Vue Form Wizard is a Vue.js component library that simplifies the creation of multi-step forms and wizards. It provides an intuitive interface for building complex form flows with built-in validation, navigation, and customization options.

Pros

  • Easy to integrate and use with Vue.js projects
  • Highly customizable with various styling and layout options
  • Built-in form validation support
  • Responsive design for mobile and desktop

Cons

  • Limited documentation for advanced use cases
  • Dependency on Vue.js ecosystem
  • May require additional styling for complex layouts
  • Some users report issues with TypeScript support

Code Examples

  1. Basic Form Wizard Setup:
<template>
  <form-wizard @on-complete="onComplete">
    <tab-content title="Personal details" :before-change="validateStep1">
      <input v-model="firstName" type="text" placeholder="First Name">
      <input v-model="lastName" type="text" placeholder="Last Name">
    </tab-content>
    <tab-content title="Additional Info" :before-change="validateStep2">
      <input v-model="email" type="email" placeholder="Email">
    </tab-content>
  </form-wizard>
</template>

<script>
import { FormWizard, TabContent } from 'vue-form-wizard'
import 'vue-form-wizard/dist/vue-form-wizard.min.css'

export default {
  components: {
    FormWizard,
    TabContent
  },
  methods: {
    validateStep1() {
      return this.firstName && this.lastName
    },
    validateStep2() {
      return this.email && this.email.includes('@')
    },
    onComplete() {
      alert('Form completed!')
    }
  }
}
</script>
  1. Custom Styling:
<template>
  <form-wizard
    color="#3498db"
    error-color="#e74c3c"
    shape="circle"
  >
    <!-- Tab contents here -->
  </form-wizard>
</template>
  1. Programmatic Navigation:
<template>
  <form-wizard ref="formWizard">
    <!-- Tab contents here -->
    <button @click="goToStep(2)">Go to Step 2</button>
  </form-wizard>
</template>

<script>
export default {
  methods: {
    goToStep(step) {
      this.$refs.formWizard.goToTab(step)
    }
  }
}
</script>

Getting Started

  1. Install the package:

    npm install vue-form-wizard
    
  2. Import and use in your Vue component:

    <template>
      <form-wizard>
        <tab-content title="Step 1">
          <!-- Your form fields for step 1 -->
        </tab-content>
        <tab-content title="Step 2">
          <!-- Your form fields for step 2 -->
        </tab-content>
      </form-wizard>
    </template>
    
    <script>
    import { FormWizard, TabContent } from 'vue-form-wizard'
    import 'vue-form-wizard/dist/vue-form-wizard.min.css'
    
    export default {
      components: {
        FormWizard,
        TabContent
      }
    }
    </script>
    
  3. Customize as needed and add your form logic.

Competitor Comparisons

Tiny (<2k gzipped) and dependency free mask input for Vue.js

Pros of vue-the-mask

  • Lightweight and focused on input masking
  • Easy to implement for specific input formatting needs
  • Supports custom mask patterns

Cons of vue-the-mask

  • Limited to input masking functionality
  • Lacks form validation and multi-step form features
  • May require additional plugins for complex form handling

Code Comparison

vue-the-mask:

<template>
  <input v-mask="'##/##/####'" type="text" />
</template>

<script>
import VueMask from 'vue-the-mask'
export default {
  directives: { mask: VueMask.VueMaskDirective }
}
</script>

vue-form-wizard:

<template>
  <form-wizard>
    <tab-content title="Personal details">
      <!-- Form fields -->
    </tab-content>
    <tab-content title="Additional Info">
      <!-- More form fields -->
    </tab-content>
  </form-wizard>
</template>

<script>
import { FormWizard, TabContent } from 'vue-form-wizard'
export default {
  components: { FormWizard, TabContent }
}
</script>

vue-the-mask is ideal for simple input formatting tasks, while vue-form-wizard offers a comprehensive solution for multi-step forms with built-in validation and navigation. Choose vue-the-mask for lightweight input masking needs, and vue-form-wizard for complex, multi-step form requirements.

✅ Painless Vue forms

Pros of vee-validate

  • More comprehensive validation library with a wide range of built-in rules
  • Supports asynchronous validation and custom validation rules
  • Integrates well with various UI frameworks and form libraries

Cons of vee-validate

  • Steeper learning curve due to its extensive feature set
  • May be overkill for simple form validation scenarios
  • Requires more setup and configuration compared to vue-form-wizard

Code Comparison

vee-validate:

<template>
  <Form @submit="onSubmit">
    <Field name="email" :rules="emailRules" />
    <ErrorMessage name="email" />
    <button type="submit">Submit</button>
  </Form>
</template>

vue-form-wizard:

<template>
  <form-wizard @on-complete="onComplete">
    <tab-content title="Personal details">
      <input type="text" v-model="email" />
    </tab-content>
    <tab-content title="Additional Info">
      <!-- Additional fields -->
    </tab-content>
  </form-wizard>
</template>

While vee-validate focuses on form validation with a rich set of features, vue-form-wizard is designed specifically for creating multi-step form wizards. vee-validate offers more flexibility in validation scenarios, but vue-form-wizard provides a simpler approach for creating wizard-like forms with built-in navigation and progress tracking.

Simple, lightweight model-based validation for Vue.js

Pros of Vuelidate

  • Lightweight and flexible validation library
  • Supports model-based validations
  • Easy integration with existing Vue projects

Cons of Vuelidate

  • Requires more manual setup for form wizards
  • Less out-of-the-box styling options
  • May need additional components for multi-step forms

Code Comparison

vue-form-wizard:

<form-wizard>
  <tab-content title="Personal details">
    <!-- Step 1 content -->
  </tab-content>
  <tab-content title="Additional Info">
    <!-- Step 2 content -->
  </tab-content>
</form-wizard>

Vuelidate:

<template>
  <form @submit.prevent="submitForm">
    <input v-model="$v.name.$model">
    <span v-if="$v.name.$error">Name is invalid</span>
    <button type="submit">Submit</button>
  </form>
</template>

<script>
import { required, minLength } from 'vuelidate/lib/validators'

export default {
  validations: {
    name: { required, minLength: minLength(4) }
  }
}
</script>

vue-form-wizard provides a more structured approach for creating multi-step forms with built-in navigation and progress tracking. Vuelidate, on the other hand, focuses on form validation and can be used in various form layouts, including multi-step forms with additional implementation.

While vue-form-wizard offers a complete solution for wizards, Vuelidate provides more flexibility for custom form implementations and validations. The choice between the two depends on the specific requirements of your project and the level of customization needed.

:clipboard: A schema-based form generator component for Vue.js

Pros of vue-form-generator

  • More flexible and customizable for complex form scenarios
  • Supports a wider range of form field types out of the box
  • Better suited for dynamic form generation based on schema definitions

Cons of vue-form-generator

  • Steeper learning curve due to its extensive feature set
  • May be overkill for simple form implementations
  • Less focus on wizard-style multi-step forms

Code Comparison

vue-form-generator:

<template>
  <vue-form-generator :schema="schema" :model="model" :options="formOptions">
  </vue-form-generator>
</template>

<script>
export default {
  data() {
    return {
      model: {},
      schema: {
        fields: [
          {
            type: "input",
            inputType: "text",
            label: "Name",
            model: "name"
          }
        ]
      },
      formOptions: {}
    }
  }
}
</script>

vue-form-wizard:

<template>
  <form-wizard @on-complete="onComplete">
    <tab-content title="Personal details">
      <input v-model="name" type="text" placeholder="Name">
    </tab-content>
  </form-wizard>
</template>

<script>
export default {
  data() {
    return {
      name: ''
    }
  },
  methods: {
    onComplete() {
      // Handle form submission
    }
  }
}
</script>

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Vue form wizard

Coverage Status

A dynamic wizard to split your forms easier

Vue-form-wizard is a vue based component with no external depenendcies which simplifies tab wizard management.

Demos:

Basic demo

Other demos:

In browser playground

Documentation

NPM DownloadsLast 30 Days