---
title: "Discussion on \"How to add router progress bar in Next.js with one line of code 🤯\" | Hashnode"
description: "Discussion on \"How to add router progress bar in Next.js with one line of code 🤯\". The pages in Next.js are lazy-loaded so if you fetch some API or fetch data from a database it can take a few seconds to reach the second page. So to let the user know that the page is being loaded we will add a progress bar at the top of the screen...."
url: "https://hashnode.com/posts/how-to-add-router-progress-bar-in-nextjs-with-one-line-of-code/61067ce13b9b85399dcf4637"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How to add router progress bar in Next.js with one line of code 🤯](https://blog.avneesh.tech/how-to-add-router-progress-bar-in-nextjs-with-one-line-of-code?utm_source=hashnode&utm_medium=feed)

The pages in Next.js are lazy-loaded so if you fetch some API or fetch data from a database it can take a few seconds to reach the second page. So to let the user know that the page is being loaded we will add a progress bar at the top of the screen....

Aug 1, 2021 · 2 min read · blog.avneesh.tech  
Updated Aug 5, 2021  
Read the article

-   [#nextjs](https://hashnode.com/tag/nextjs)
-   [#reactjs](https://hashnode.com/tag/reactjs)
-   [#code](https://hashnode.com/tag/code)

## Written by

[Avneesh Agarwal](https://hashnode.com/@avneesh0612)

@avneesh0612

  
[View profile](https://hashnode.com/@avneesh0612)

Fullstack web3 developer

16 yo full stack web3 developer building cool shit and teaching others

## Responses 2

Markdown supported · ⌘↵ to post

[Prashoon Bhattacharjee](https://hashnode.com/@PrashoonB)

[Dec 11, 2021](https://hashnode.com/posts/how-to-add-router-progress-bar-in-nextjs-with-one-line-of-code/61067ce13b9b85399dcf4637/comment/61b4c53eb18f1f0c6830105b)

This article helped me a lot! :)

[Avneesh Agarwal](https://hashnode.com/@avneesh0612)

[Dec 11, 2021](https://hashnode.com/posts/how-to-add-router-progress-bar-in-nextjs-with-one-line-of-code/61067ce13b9b85399dcf4637/comment/61b4c53eb18f1f0c6830105b#reply-61b4c719b18f1f0c68301080)

Glad it helped!

[Arjun Joshi](https://hashnode.com/@arjun2008)

[Aug 1, 2021](https://hashnode.com/posts/how-to-add-router-progress-bar-in-nextjs-with-one-line-of-code/61067ce13b9b85399dcf4637/comment/6106bf1e33a2a43971a2ec21)

Helpful article bro, wl let you know when I implement it

[Avneesh Agarwal](https://hashnode.com/@avneesh0612)

[Aug 1, 2021](https://hashnode.com/posts/how-to-add-router-progress-bar-in-nextjs-with-one-line-of-code/61067ce13b9b85399dcf4637/comment/6106bf1e33a2a43971a2ec21#reply-6106c1263b9b85399dcf4d01)

Sure thing
