0.1.1 • Published 4 years ago

vue2-progress-bar v0.1.1

Weekly downloads
5
License
MIT
Repository
github
Last release
4 years ago

vue2-progress-bar npm package

A linear progress bar component for Vue.js. Uses SVG and javascript to animate a radial progress bar with a gradient.

Live Demo

Requirements

  • Vue.js ^2.0.0 (Compatible with Vue 1.0 or 2.0)
  • A module bundler such as webpack or use the minified version on its own.

Installation

$ npm install --save vue2-progress-bar

Usage

<template>
  <progress-bar
    :diameter="200"
    :completed-steps="completedSteps"
    :total-steps="totalSteps"
  >
    <template v-slot:header>this is header slot </template>
    <template v-slot:footer> this is footer slot</template>
    <template v-slot:tip> {{(completedSteps/totalSteps)*100}}%</template>
  </progress-bar>
</template>

<script>
  import ProgressBar from "vue2-progress-bar";

  export default {
    data() {
      return {
        completedSteps: 0,
        totalSteps: 10
      };
    },
    components: {
      ProgressBar
    }
  };
</script>

Props

NameDefault valueDescription
height10Height of the progress bar in pixels.
width10Width of the progress bar in pixels.
totalSteps10Total number of steps to complete progress bar.
completedSteps0Number of completed steps in the progress bar.
startColor#73cbfeThe color of the leading edge of the progress bar gradient.
stopColor#458efdThe secondary color of the progress bar gradient.
innerStrokeColor#d6efffBackground color of the progress bar.
strokeLinecaproundThe type of stroke linecap for circle.
animateSpeed1000The amount of time in milliseconds to animate one step.
timingFunclinearThe transition timing function to use for the CSS transition. See transition-timing-function.
showTiptrueShow tip text after the progress bar.

Slot

NameDefault valueDescription
headernullheader slot of the progress bar .
footernullfooter slot of the progress bar.
tipcompletedSteps/totalStepstip content slot after the progress bar.

Dev

npm run dev

📒 ChangeLog

ChangeLog

License

The MIT License