Code Monkey home page Code Monkey logo

vue3-steppy's Introduction

Steppy

A customizable Stepper component for Vue 3

npm version

DemoKey FeaturesHow To UseDependenciesLicense

Demo

You can try a live demo here

Key Features

  • Keep track of current step
  • Change step content
  • Configure finalization
  • Show loading spinner
  • Customizable
    • Colors
    • Titles
    • Icons
    • Button text
    • Circle size

How To Use

Install

$ npm install vue3-steppy

Import

import {Steppy} from 'vue3-steppy'

Template

<Steppy v-model:step="step">
  <template #1><!-- Step 1 Content --></template>
  <template #2><!-- Step 2 Content --></template>
  <template #3><!-- Step 3 Content --></template>
</Steppy>

API Props

/**
 * Contains the current step. Very similar to a
 * `value` attribute on an input. In most cases, you'll want
 * to set this as a two-way binding, using the `v-model` directive.
 * @type {Number}
 */
step: {
  type: Number,
  default: 1
}

/**
 * Contains the steps with custom titles and icons.
 * @type {Array}
 * 
 * @param {Image} iconSuccess - You can point to an imported icon from you assets like:
 * import CheckMark from '../assets/check-mark.png'
 * If you set it to null, a default SVG will be used with primary color 1.
 * 
 * @param {boolean} isValid - Used to determine if the user can move to the next step.
 */
tabs: {
  type: Array,
  default: reactive([
    {
      title: 'Step 1',
      iconSuccess: null,
      isValid: true
    },
    {
      title: 'Step 2',
      iconSuccess: null,
      isValid: true
    },
    {
      title: 'Step 3',
      iconSuccess: null,
      isValid: true
    }
  ])
}

/**
 * Function that will run after all steps are completed (done button is clicked).
 * @type {Function}
 */
finalize: {
  type: Function,
  default: function () {
    return {}
  }
}

/**
 * Text for back button.
 * @type {String}
 */
backText: {
  type: String,
  default: 'Back'
}

/**
 * Text for next button.
 * @type {String}
 */
nextText: {
  type: String,
  default: 'Next'
}

/**
 * Text for done button.
 * @type {String}
 */
doneText: {
  type: String,
  default: 'Done'
}

/**
 * Show loading spinner on done button
 * @type {Boolean}
 */
loading: {
  type: Boolean,
  default: false
}

/**
 * Primary Color 1
 * @type {String}
 */
primaryColor1: {
  type: String,
  default: 'orange'
}

/**
 * Background Color of the content box
 * @type {String}
 */
backgroundColor: {
  type: String,
default: "#fff",
},

/**
 * Primary Color 2
 * @type {String}
 */
primaryColor2: {
  type: String,
  default: '#fff'
}

/**
 * Adjust the size of the circles
 * @type {Number}
 */
circleSize: {
  type: Number,
  default: 68,
}

Dependencies

This software uses the following open source packages:

Dev Dependencies

Support

Buy Me A Coffee

License

MIT


GitHub Laximas  ·  LinkedIn Mike Konstantakos

vue3-steppy's People

Contributors

laximas avatar dependabot[bot] avatar snyk-bot avatar maximilianocalderon avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.