1.0.32 • Published 1 year ago

@os-team/next-nprogress v1.0.32

Weekly downloads
3
License
MIT
Repository
gitlab
Last release
1 year ago

@os-team/next-nprogress NPM version BundlePhobia

Slim progress bar for Next.js applications.

Initializes nprogress for Next.js and applies styles using Emotion.

Usage

Step 1. Install the package

yarn add @os-team/next-nprogress

Step 2. Initialize nprogress in the ./pages/_app.tsx file

import React, { useEffect, useMemo } from 'react';
import { initNProgress, NProgressGlobalStyles } from '@os-team/next-nprogress';
import { ThemeProvider } from '@os-design/theming';
import { useRouter } from 'next/router';

const App: React.FC = ({ Component, pageProps }) => {
  const router = useRouter();

  // Initialize nprogress
  useEffect(() => {
    initNProgress(router);
  }, [router]);

  return (
    <ThemeProvider>
      <NProgressGlobalStyles />
      <Component {...pageProps} />
    </ThemeProvider>
  );
};

export default App;

Note that NProgressGlobalStyles must be inside ThemeProvider, as it uses the colorPrimary from theme.

1.0.32

1 year ago

1.0.31

1 year ago

1.0.29

2 years ago

1.0.28

2 years ago

1.0.30

2 years ago

1.0.26

2 years ago

1.0.27

2 years ago

1.0.25

3 years ago

1.0.24

3 years ago

1.0.22

3 years ago

1.0.23

3 years ago

1.0.21

3 years ago

1.0.20

3 years ago

1.0.19

3 years ago

1.0.18

3 years ago

1.0.17

4 years ago

1.0.16

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago