1
1
# Swup Progress Bar Plugin
2
2
3
- This [ swup] ( https://github.com/swup/swup ) plugin will display a progress bar for
4
- all requests taking longer than ~ 300ms.
3
+ A [ swup] ( https://swup.js.org ) plugin for displaying a progress bar.
4
+
5
+ Shows a loading indicator for requests taking longer than ~ 300ms.
6
+
5
7
6
8
## Installation
7
9
8
- This plugin can be installed with npm
10
+ Install the plugin from npm and import it into your bundle.
9
11
10
12
``` bash
11
13
npm install @swup/progress-plugin
12
14
```
13
15
14
- and included with import
15
-
16
- ``` shell
16
+ ``` js
17
17
import SwupProgressPlugin from ' @swup/progress-plugin' ;
18
18
```
19
19
20
- or included from the dist folder
20
+ Or include the minified production file from a CDN:
21
21
22
22
``` html
23
- <script src =" ./dist/SwupProgressPlugin.js " ></script >
23
+ <script src =" https://unpkg.com/@swup/progress-plugin@3 " ></script >
24
24
```
25
25
26
26
## Usage
@@ -52,7 +52,7 @@ The progress bar has a class name of `swup-progress-bar` you can use for styling
52
52
transition: 300 ,
53
53
delay: 300 ,
54
54
initialValue: 0.25 ,
55
- hideImmediately : true
55
+ finishAnimation : true
56
56
}
57
57
```
58
58
@@ -62,7 +62,7 @@ Class name to use for the container div.
62
62
63
63
### transition
64
64
65
- Length of CSS transition between loading states, in milliseconds.
65
+ Length of the CSS transition between loading states, in milliseconds.
66
66
67
67
### delay
68
68
@@ -76,8 +76,6 @@ To create a slightly more "realistic" appearance, the progress bar will start
76
76
out at a random position beteen 0 and the value of this option. Set to ` 0 ` to
77
77
always start from the left.
78
78
79
- ### hideImmediately
80
-
81
- Whether the progress bar is hidden instantly after a page visit.
79
+ ### finishAnimation
82
80
83
- Set to ` false ` to always complete the transition to ` width: 100%` before hiding it .
81
+ Whether the progress bar will complete the transition to 100% before hiding.
0 commit comments