
Security News
Open Source CAI Framework Handles Pen Testing Tasks up to 3,600× Faster Than Humans
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
nextjs-progressbar
Advanced tools
A simple Next.js progressbar component using NProgress.
I've created this Blog to help you create your own progressbar
Demo: https://demo-nextjs-progressbar.vercel.app
npm i nextjs-progressbar
After installing the package, import NextNProgress
in your pages/_app.js
file:
import NextNProgress from 'nextjs-progressbar';
And for rendering add <NextNProgress />
to your return()
in MyApp()
:
import NextNProgress from 'nextjs-progressbar';
export default function MyApp({ Component, pageProps }) {
return (
<>
<NextNProgress />
<Component {...pageProps} />;
</>
);
}
If no props are passed to <NextNProgress />
, below is the default configuration applied.
<NextNProgress color="#29D" startPosition={0.3} stopDelayMs={200} height={3} showOnShallow={true} />
color
: to change the default color of progressbar. You can also use rgb(,,)
or rgba(,,,)
.startPosition
: to set the default starting position : 0.3 = 30%
.stopDelayMs
: time for delay to stop progressbar in ms
.height
: height of progressbar in px
.showOnShallow
: You can choose whether you want the progressbar to be displayed if you're using shallow routing. It takes a boolean. Learn more about shallow routing in Next.js docs.We use internal css in this package. If you are using csp, you can add nonce to the <style>
tag by providing nonce
prop to <NextNProgress />
component.
<NextNProgress nonce="my-nonce" />
You can use transformCSS
prop to pass custom css.
Note: You must return a JSX.Element
from the function.
<NextNProgress
transformCSS={(css) => {
// css is the default css string. You can modify it and return it or return your own css.
return <style>{css}</style>;
}}
/>
You can use other configurations which NProgress provides by adding a JSON in options
props.
<NextNProgress options={{ easing: 'ease', speed: 500 }} />
v0.0.16
React.memo
for better performanceFAQs
Nprogress component for Next.js app.
The npm package nextjs-progressbar receives a total of 80,192 weekly downloads. As such, nextjs-progressbar popularity was classified as popular.
We found that nextjs-progressbar demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.