question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add NProgress component

See original GitHub issue
  • I have searched the issues of this repository and believe that this is not a duplicate.

Summary 💡

Provide a component to display a progress bar with Next.js, Gatsby, etc.

Examples 🌈

import * as React from 'react';
import NProgressBar from '@material-ui/core/NProgressBar';

Router.onRouteChangeStart = () => {
  NProgress.start();
};

Router.onRouteChangeComplete = () => {
  NProgress.done();
};

Router.onRouteChangeError = () => {
  NProgress.done();
};

function AppFrame(props) {
  return (
    <NProgressBar />
  )
}

Sep-04-2020 17-49-59

Motivation 🔦

On Chrome mobile, a progress bar is displayed by default. On Chrome desktop, no progress bars are displayed. However, a number of popular websites are using an approach similar to Next.js and Gatsby. You can find YouTube 32B sessions/month, Facebook 25B sessions/month.

As it turns out, we already have this component available under @material-ui/docs/NProgressBar and use it for our documentation. We could introduce this component in the lab, with a couple of improvements, and kill the docs npm package. The improvements we could bring:

  • Remove the dependency on nprogress, the logic is short and simple
  • To account for the difference of behavior between mobile (chrome) and desktop: we could only display the progress bar on desktop after an initial 300ms? delay, to avoid unnecessary distractions for pages that load fast. It would also better match the expected experience of end-users on desktop. https://nextjs.org/ has a very similar behavior.

Benchmark

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:44
  • Comments:15 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
italodeandracommented, Jul 13, 2022

Hi @bryantobing12,

Yes, the NProgress component is not available on MUI. I was the initial responsible for it but its development was frozen.

I’m currently not working with MUI so I can’t really invest time on it. If you’re interested, you can continue it.

1reaction
oliviertassinaricommented, Apr 22, 2021

@italodeandra the source of truth of the transition is in https://translate.material-ui.com. Your changes will be lost. I wouldn’t encourage to care, for now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

rstacruz/nprogress: For slim progress bars like on ... - GitHub
Add progress to your Ajax calls! Bind it to the jQuery ajaxStart and ajaxStop events. Make a fancy loading bar even without Turbolinks/Pjax!...
Read more >
NProgress: slim progress bars in JavaScript - Rico Sta. Cruz
A nanoscopic progress bar. Featuring realistic trickle animations to convince your users that something is happening! NProgress.start() — shows the progress bar.
Read more >
How to add routing loader using nprogress in Next.js? - DEV ...
Today, using the router in Next.js, I'll show you how you can create a page loader that shows a progress bar while we...
Read more >
The comprehensive guide to use NProgress in Next.js [easy ...
Add NProgress to your Next.js project. To use Nprogress in your Next.js project, we first need to Navigate to our project and: Install...
Read more >
nprogress | Yarn - Package Manager
#93 - Remove jQuery dependency in component (@slang800); #120 - Fix the Readme showing a wrong example for ease (@teeceepee) ... yarn add...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found