vue-step-indicator
Version:
Simple step indicator for Vue.js
52 lines (35 loc) ⢠1.48 kB
Markdown
# vue-step-indicator
[](https://npmjs.com/package/vue-step-indicator) [](https://npmjs.com/package/vue-step-indicator) [](https://circleci.com/gh/egoist/vue-step-indicator/tree/master)
Simple step indicator for Vue.js
## Install
```bash
yarn add vue-step-indicator
```
CDN: [UNPKG](https://unpkg.com/vue-step-indicator/dist/) | [jsDelivr](https://cdn.jsdelivr.net/npm/vue-step-indicator/dist/) (available as `window.StepIndicator`)
## Usage
šš [Check out the demo!](https://vue-step-indicator.egoist.moe)
```vue
<template>
<step-indicator :current="1" :total="3"></step-indicator>
</template>
<script>
import StepIndicator from 'vue-step-indicator'
export default {
components: {
StepIndicator
}
}
</script>
<style src="vue-step-indicator/dist/vue-step-indicator.css"></style>
```
## API
### Props
|Prop|Type|Default|Description|
|---|---|---|---|
|current|number|(Required)|Index of current step|
|total|number|(Required)|Total steps|
|currentColor|string|`'rgb(68, 0, 204)'`|Color of current step|
|defaultColor|string|`'rgb(130, 140, 153)'`|Default color of each step|
|handleClick|function<index>||Triggered when an indicator is clicked|
## License
MIT © [EGOIST](https://github.com/egoist)