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
nextjs-toploader
A Next.js Top Loading Bar component made using nprogress, works with Next.js 15 and Next.js 14 and React.
top-loading-bar
top loading bar for javascript frameworks
solid-top-loading-bar
A very simple, highly customisable solidjs top loader component, partially inspired by react-top-loading-bar
@weblif/react-top-loading-bar
A very simple, highly customisable react top loader component.
A very simple, highly customisable youtube-like react loader component.
npm install react-top-loading-bar
Typescript
Module System
Min. Node Version
Node Version
NPM Version
97.9
Supply Chain
100
Quality
79.1
Maintenance
100
Vulnerability
100
License
TypeScript (83.57%)
CSS (15.08%)
HTML (1.36%)
Total Downloads
6,972,342
Last Day
2,985
Last Week
59,559
Last Month
242,240
Last Year
2,408,755
MIT License
732 Stars
105 Commits
62 Forks
6 Watchers
5 Branches
12 Contributors
Updated on Jun 10, 2025
Minified
Minified + Gzipped
Latest Version
3.0.2
Package Id
react-top-loading-bar@3.0.2
Unpacked Size
68.66 kB
Size
12.60 kB
File Count
9
NPM Version
10.8.2
Node Version
20.18.1
Published on
Dec 22, 2024
Cumulative downloads
Total Downloads
Last Day
-2.6%
2,985
Compared to previous day
Last Week
-3.8%
59,559
Compared to previous week
Last Month
3%
242,240
Compared to previous month
Last Year
25.2%
2,408,755
Compared to previous year
1
7
1npm install --save react-top-loading-bar
1yarn add react-top-loading-bar
https://unpkg.com/react-top-loading-bar
1import { useLoadingBar } from "react-top-loading-bar"; 2 3const App = () => { 4 const { start, complete } = useLoadingBar({ 5 color: "blue", 6 height: 2, 7 }); 8 9 return ( 10 <div> 11 <button onClick={() => start()}>Start</button> 12 <button onClick={() => complete()}>Complete</button> 13 </div> 14 ); 15};
1import { LoadingBarContainer } from "react-top-loading-bar"; 2 3const Parent = () => { 4 return ( 5 <LoadingBarContainer> 6 <App /> 7 </LoadingBarContainer> 8 ); 9};
1import { useRef } from "react"; 2import LoadingBar, { LoadingBarRef } from "react-top-loading-bar"; 3 4const App = () => { 5 // prettier-ignore 6 const ref = useRef<LoadingBarRef>(null); 7 8 return ( 9 <div> 10 <LoadingBar color="#f11946" ref={ref} shadow={true} /> 11 <button onClick={() => ref.current?.continuousStart()}> 12 Start Continuous Loading Bar 13 </button> 14 <button onClick={() => ref.current?.staticStart()}> 15 Start Static Loading Bar 16 </button> 17 <button onClick={() => ref.current?.complete()}>Complete</button> 18 </div> 19 ); 20};
1import { 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 </div> 18 ); 19};
Methods | Parameters | Descriptions |
---|---|---|
start(loaderType?) | continuous (default) or static | Starts the loading indicator. If type is "static" it will start the static bar otherwise it will start the animated continuous bar. |
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. | |
increase(value) | Number | Adds a value to the loading indicator. |
decrease(value) | Number | Decreases a value to the loading indicator. |
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. |
MIT © Klendi Goci | klendi.dev | GitHub @klendi
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 6
Details
Reason
Found 3/12 approved changesets -- score normalized to 2
Reason
1 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
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
14 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-09
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