Gathering detailed insights and metrics for react-top-loading-bar
Gathering detailed insights and metrics for react-top-loading-bar
Gathering detailed insights and metrics for react-top-loading-bar
Gathering detailed insights and metrics for react-top-loading-bar
npm install react-top-loading-bar
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
708 Stars
82 Commits
60 Forks
7 Watching
11 Branches
12 Contributors
Updated on 24 Nov 2024
Minified
Minified + Gzipped
TypeScript (39.91%)
JavaScript (34.44%)
CSS (17.93%)
HTML (7.72%)
Cumulative downloads
Total Downloads
Last day
-10.5%
8,314
Compared to previous day
Last week
4.2%
47,290
Compared to previous week
Last month
3.6%
194,358
Compared to previous month
Last year
26.5%
2,132,310
Compared to previous year
1
25
1npm install --save react-top-loading-bar
1yarn add react-top-loading-bar
https://unpkg.com/react-top-loading-bar
1import React, { useRef } from 'react' 2import LoadingBar from '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 '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. | |
getProgress() | Get the current progress value. |
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 | transparent | 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. |
Add your own project. Make a PR
MIT © Klendi Gocci | klendi.dev
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 10/18 approved changesets -- score normalized to 5
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
106 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More