vue-scroll-progress
Version:
Simple Vue.js plugin for page scroll progress bar
74 lines (54 loc) • 2.35 kB
Markdown
# vue-scroll-progress 🎉
> Simple Vue.js plugin for page scroll progress bar
[](https://vuejs.org/)
[](https://www.npmjs.com/package/vue-scroll-progress)
[](https://www.npmjs.com/package/vue-scroll-progress)
[](https://github.com/vuejs/awesome-vue#progress-bar)
[](https://github.com/spemer/vue-scroll-progress)
[](https://github.com/spemer/vue-scroll-progress)
[](https://github.com/spemer/vue-scroll-progress)
[Live Demo](https://spemer.github.io/vue-scroll-progress/)
<img src="https://github.com/spemer/vue-scroll-progress/blob/master/docs/src/assets/vue-scroll-progress.gif?raw=true" height="25%" width="25%">
## Installation
```bash
npm i vue-scroll-progress --save
```
```bash
yarn add vue-scroll-progress
```
### CDNs
[jsDelivr](https://cdn.jsdelivr.net/npm/vue-scroll-progress/),
[UNPKG](https://unpkg.com/vue-scroll-progress/),
[bundle.run](https://bundle.run/vue-scroll-progress)
## Usage
### main.js
```javascript
// YourComponent.vue or main.js for global usage
import Vue from "vue";
import VueScrollProgress from "vue-scroll-progress";
Vue.use(VueScrollProgress);
```
### Use in component
```html
<!-- .vue template -->
<template>
<VueScrollProgress></VueScrollProgress>
</template>
```
### Set progress bar style, and customize as you want(Optional)
```css
<style>
/* play with some lines below */
#progress-container-el {
/* background */
background-color: transparent !important;
top: calc(100% - 4px) !important; /* remove if Vue 3.x */
}
#progress-el {
/* progress bar */
background-color: red !important;
}
</style>
```
## Author
[Hyouk Seo(Spemer)](https://github.com/spemer)