Vue.js plugin for page scroll progress bar

Scroll to see the progress bar !. Vue.js plugin for page scroll progress bar

Getting started

Install

source-shell
$ npm install @guillaumebriday/vue-scroll-progress-bar --save

or

source-shell
$ yarn add @guillaumebriday/vue-scroll-progress-bar

Install the plugin into Vue:

source-js
import Vue from 'vue'
import VueScrollProgressBar from '@guillaumebriday/vue-scroll-progress-bar'

Vue.use(VueScrollProgressBar)

Or use the component directly:

source-js
import { VueScrollProgressBar } from '@guillaumebriday/vue-scroll-progress-bar'

export default {
  components: {
    VueScrollProgressBar
  },

  // ...
}

Basic Usage

text-html-basic
<template>
  <vue-scroll-progress-bar @complete="handleComplete" height="2rem" />
</template>

Props

key description default
height Height of the progress bar '.5rem'
backgroundColor Background property of the progress bar 'linear-gradient(to right, #38C172, #51D88A)'
barClass Class attribute of the progress bar '{}'
containerColor Background property of the progress bar container 'transparent'
zIndex z-index property of the progress bar container '50'
containerClass Class attribute of the progress bar container '{"progress-bar-container--container": true}'

With :

source-css
.progress-bar-container--container {
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
}

containerClass must be used to override the .progress-bar-container--container default class. You can use the default :class syntax on the component to add classes if needed.

Events

key description
begin When scroll reached 0%
complete When scroll reached 100%

Develop

Project setup

source-shell
$ yarn install
$ yarn build

Open example app

source-shell
$ cd example
$ yarn
$ yarn serve

Lints and fixes files

source-shell
$ yarn run lint

Contributing

Do not hesitate to contribute to the project by adapting or adding features ! Bug reports or pull requests are welcome.

License

This project is released under the MIT license.

Github

guillaumebriday/vue-scroll-progress-bar

#vuejs #javascript #programming #vue-js

Vue.js plugin for page scroll progress bar
3.45 GEEK