2.0.6 • Published 5 years ago

@dmartss/with-nprogress v2.0.6

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

@dmartss/with-nprogress

Next.js HOC to integrate NProgress inside your app.

This is configured to run only after a delay of (default) 300ms. This means if the page change takes too long it will render the progress bar, but if it's fast enough it will avoid rendering it.

Usage

Install it

yarn add next-nprogress

Import it inside your pages/_app.js;

import withNProgress from '@dmartss/with-nprogress'
import NProgressStyles from '@dmartss/with-nprogress/styles'

Wrap your custom App container with it

const msDelay = 300 // default is 300
export default withNProgress(msDelay)(MyApp)

And render NProgressStyles inside your App container or layout component

// the default progress bar and spinner color is #29d, it could be changed for any CSS color
<NProgressStyles color="#29d" />

That's it. Now NProgress will work automatically and will render the correct styles using styled-jsx.

2.0.6

5 years ago

2.0.5

5 years ago

2.0.4

5 years ago

2.0.3

5 years ago

2.0.2

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago