Gathering detailed insights and metrics for @weblif/react-top-loading-bar
Gathering detailed insights and metrics for @weblif/react-top-loading-bar
Gathering detailed insights and metrics for @weblif/react-top-loading-bar
Gathering detailed insights and metrics for @weblif/react-top-loading-bar
A very simple, highly customisable youtube-like react loader component.
npm install @weblif/react-top-loading-bar
Typescript
Module System
Min. Node Version
Node Version
NPM Version
66.4
Supply Chain
97
Quality
75
Maintenance
100
Vulnerability
100
License
TypeScript (43.56%)
JavaScript (32.56%)
CSS (16.75%)
HTML (7.13%)
Total Downloads
6,983
Last Day
12
Last Week
23
Last Month
80
Last Year
1,268
MIT License
73 Commits
2 Branches
Updated on Apr 22, 2022
Minified
Minified + Gzipped
Latest Version
2.1.2
Package Id
@weblif/react-top-loading-bar@2.1.2
Unpacked Size
66.41 kB
Size
10.28 kB
File Count
12
NPM Version
8.7.0
Node Version
16.11.1
Cumulative downloads
Total Downloads
1npm install --save @weblif/react-top-loading-bar
1yarn add @weblif/react-top-loading-bar
1import React, { useRef } from 'react' 2import LoadingBar from '@weblif/react-top-loading-bar' 3 4const App = () => { 5 const ref = useRef(null) 6 7 return ( 8 <div> 9 <LoadingBar color="#f11946" ref={ref} /> 10 <button onClick={() => ref.current.continuousStart()}> 11 Start Continuous Loading Bar 12 </button> 13 <button onClick={() => ref.current.staticStart()}> 14 Start Static Loading Bar 15 </button> 16 <button onClick={() => ref.current.complete()}>Complete</button> 17 <br /> 18 </div> 19 ) 20} 21 22export default App
1import React, { useState } from 'react' 2import LoadingBar from '@weblif/react-top-loading-bar' 3 4const App = () => { 5 const [progress, setProgress] = useState(0) 6 7 return ( 8 <div> 9 <LoadingBar 10 color="#f11946" 11 progress={progress} 12 onLoaderFinished={() => setProgress(0)} 13 /> 14 <button onClick={() => setProgress(progress + 10)}>Add 10%</button> 15 <button onClick={() => setProgress(progress + 20)}>Add 20%</button> 16 <button onClick={() => setProgress(100)}>Complete</button> 17 <br /> 18 </div> 19 ) 20} 21 22export default App
Methods | Parameters | Descriptions |
---|---|---|
add(value) | Number | Adds a value to the loading indicator. |
decrease(value) | Number | Decreases a value to the loading indicator. |
continuousStart(startingValue, refreshRate) | Number (optional), Number(optional) | Starts the loading indicator with a random starting value between 20-30, then repetitively after an refreshRate, increases it by a random value between 2-10. This continues until it reaches 90% of the indicator's width. |
staticStart(startingValue) | Number (optional) | Starts the loading indicator with a random starting value between 30-50. |
complete() | Makes the loading indicator reach 100% of his width and then fade. |
Property | Type | Default | Description |
---|---|---|---|
progress | Number | 0 | The progress/width indicator, progress prop varies from 0 to 100 . |
color | String | red | The color of the loading bar, color take values like css property background: do, for example red , #000 rgb(255,0,0) etc. |
shadow | Boolean | true | Enables / Disables shadow underneath the loader. |
height | Number | 2 | The height of the loading bar in pixels. |
background | String | 3 | The loader parent background color. |
style | CSSProperties | The style attribute to loader's div | |
containerStyle | CSSProperties | The style attribute to loader's container | |
shadowStyle | CSSProperties | The style attribute to loader's shadow | |
transitionTime | Number | 300 | Fade transition time in miliseconds. |
loaderSpeed | Number | 500 | Loader transition speed in miliseconds. |
waitingTime | Number | 1000 | The delay we wait when bar reaches 100% before we proceed fading the loader out. |
className | String | You can provide a class you'd like to add to the loading bar to add some styles to it | |
containerClassName | String | You can provide a class you'd like to add to the loading bar container to add some css styles | |
onLoaderFinished | Function | This is called when the loading bar completes, reaches 100% of his width. |
MIT
No vulnerabilities found.
No security vulnerabilities found.
Last Day
0%
12
Compared to previous day
Last Week
15%
23
Compared to previous week
Last Month
23.1%
80
Compared to previous month
Last Year
-21.1%
1,268
Compared to previous year