Vue Progress Bar

0.7.5 · abandoned · verified Tue Apr 21

vue-progressbar is a lightweight progress bar component designed for Vue.js applications. The package, currently at version 0.7.5 and last published in April 2018, is explicitly built for Vue.js 1.x and 2.x, meaning it is not compatible with Vue 3. It provides a top-of-page progress indicator that can be controlled programmatically, typically integrated with vue-router for showing loading states during navigation. Key features include customizable colors, thickness, transition speeds, and positioning. Due to its age and lack of updates, it is now considered abandoned, and users developing with Vue 3 should seek modern alternatives.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates the global registration of vue-progressbar with options, its integration with Vue Router for navigation progress, and manual control using the $Progress API in a Vue 2 application.

import Vue from 'vue'
import VueProgressBar from 'vue-progressbar'
import App from './App'
import router from './router' // Assuming you have a router setup

const options = {
  color: '#bffaf3',
  failedColor: '#874b4b',
  thickness: '5px',
  transition: {
    speed: '0.2s',
    opacity: '0.6s',
    termination: 300
  },
  autoRevert: true,
  location: 'left',
  inverse: false
}

Vue.use(VueProgressBar, options)

new Vue({
  router,
  ...App,
  created () {
    this.$Progress.start() // Start progress bar on app creation

    this.$router.beforeEach((to, from, next) => {
      if (to.meta.progress !== undefined) {
        let meta = to.meta.progress
        this.$Progress.parseMeta(meta)
      }
      this.$Progress.start()
      next()
    })

    this.$router.afterEach(() => {
      this.$Progress.finish()
    })
  },
  mounted () {
    this.$Progress.finish() // Finish progress bar when App.vue is mounted
  }
}).$mount('#app')

// Inside your App.vue template:
// <template>
//     <div id="app">
//         <router-view></router-view>
//         <vue-progress-bar></vue-progress-bar>
//     </div>
// </template>

view raw JSON →