Top progress bar
A very subtle progress bar is displayed when Next.js is performing route changes, which can take some time depending on how fast the page assets and data are loaded (via getInitialProps
, getServerSideProps
or getStaticProps
with revalidate
).
We use the NProgress
library for the heavy-lifting of the progress bar UI. Under shared/modules/nprogress
, you will find a NProgress
sub-facade that:
- Has
start()
anddone()
methods that are ref-count aware, meaning you can call them several times around your code-base; only the first start call and last done call will be accounted for to show / hide the progress bar. - Adds a built-in start delay, so that the progress bar is not shown right away.
Removing this feature
If you are going to have another loading solution for Next.js page transitions, follow these steps:
- Uninstall
nprogress
. - Delete
shared/modules/nprogress
folder and its import & usage fromapp/App.js
. - Delete
shared/styles/global/nprogress.css
and its import fromshared/styles/global/index.css
. - Remove the
--z-index-nprogress
CSS variable fromshared/styles/imports/variables.css
.