vue-stappen v1.2.1
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:
But with some styling magic you can create something like this for example:
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:
- Disable the built-in TypeScript Extension
1) Run
Extensions: Show Built-in Extensions
from VSCode's command palette 2) FindTypeScript and JavaScript Language Features
, right click and selectDisable (Workspace)
- 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
6 days ago
2 months ago
2 months ago
2 months ago
2 months ago
8 months ago
9 months ago
9 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
11 months ago