1.2.1 • Published 6 days ago

vue-stappen v1.2.1

Weekly downloads
-
License
ISC
Repository
github
Last release
6 days ago

Vue Stappen 🏎️

Vue 3 skeleton components to easily help you build the best stepper/wizzard you've ever made!

TODO list

  • Update this README to someting useful, like documentation
    • It's bad
    • It's not that bad
    • It's ok
    • It's good
    • It's very good
    • It's the best documentation I've ever red
  • Prepare components for production
  • Update NPM

Installation

pnpm add vue-stappen
# or
yarn install vue-stappen
# or
yarn add vue-stappen

Example

Starting off you will be presented a default and very minimal "skeleton" stepper/wizzard:

image

But with some styling magic you can create something like this for example:

image Example styled with Tailwind and DaisyUI

The example above is created using this code:

<script setup lang="ts">
import { Stepper } from 'vue-stappen'
</script>

<template>
  <Stepper header-class="steps" step-class="border p-3 rounded-lg my-4 border-gray-200 dark:border-gray-700" v-bind="$props">
    <template #header-item="{ visited, step, active, processing, visit }">
      <li
        class="step" 
        :class="{
          'step-primary': visited,
          'step-secondary': visited && processing || step.processing,
          'step-accent font-bold text-black dark:text-white': active && !step.processing,
          'step-secondary font-bold text-black dark:text-white': active && step.processing,
        }"
        @click="visit()">
        {{ step.id }}
      </li>
    </template>

    <slot />

    <template #navigation="{ next, previous, previousStep, nextStep }">
      <div class="flex">
        <button v-if="previousStep" class="btn btn-neutral" @click="previous">Previous</button>
        <div class="w-full"></div>
        <button class="btn" :class="{ 'btn-neutral': nextStep, 'btn-primary': !nextStep }" @click="next">
          {{ nextStep ? 'Next' : 'Finish' }}
        </button>
      </div>
    </template>
  </Stepper>
</template>

Vue Stappen allows you to focus on the style of your stepper without writing stepper logic yourself. When "extending" the component like in the example above the only thing left to do is create steppers:

<script setup lang="ts">
import MyCustomStyleStepper from '@/components/MyCustomStyleStepper.vue'
import { Step } from 'vue-stappen'
</script>

<template>
  <MyCustomStyleStepper>
    <Step id="step1">
      Body step 1
    </Step>
    <Step id="step2">
      Body step 2
    </Step>
    <Step id="step3">
      Body step 3
    </Step>
  </MyCustomStyleStepper>
</template>

Documentation

Coming soon!

Contributing


Recommended IDE Setup

VSCode + Volar (and disable Vetur) + TypeScript Vue Plugin (Volar).

Type Support for .vue Imports in TS

TypeScript cannot handle type information for .vue imports by default, so we replace the tsc CLI with vue-tsc for type checking. In editors, we need TypeScript Vue Plugin (Volar) to make the TypeScript language service aware of .vue types.

If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a Take Over Mode that is more performant. You can enable it by the following steps:

  1. Disable the built-in TypeScript Extension 1) Run Extensions: Show Built-in Extensions from VSCode's command palette 2) Find TypeScript and JavaScript Language Features, right click and select Disable (Workspace)
  2. Reload the VSCode window by running Developer: Reload Window from the command palette.

Customize configuration

See Vite Configuration Reference.

Project Setup

pnpm install

Compile and Hot-Reload for Development

pnpm dev

Type-Check, Compile and Minify for Production

pnpm build

Run Unit Tests with Vitest

pnpm test:unit

Lint with ESLint

pnpm lint
1.2.1

6 days ago

1.2.0

2 months ago

1.1.0

2 months ago

1.0.1

2 months ago

1.0.0

2 months ago

1.0.0-beta.18

8 months ago

1.0.0-beta.17

9 months ago

1.0.0-beta.16

9 months ago

1.0.0-beta.15

10 months ago

1.0.0-beta.14

10 months ago

1.0.0-beta.13

10 months ago

1.0.0-beta.12

10 months ago

1.0.0-beta.11

10 months ago

1.0.0-beta.10

10 months ago

1.0.0-beta.9

10 months ago

1.0.0-beta.8

10 months ago

1.0.0-beta.7

10 months ago

1.0.0-beta.6

10 months ago

1.0.0-beta.5

10 months ago

1.0.0-beta.4

10 months ago

1.0.0-beta.3

10 months ago

1.0.0-beta.2

10 months ago

1.0.0-beta.1

10 months ago

1.0.0-beta.0

10 months ago

0.0.1-beta.0

11 months ago