npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

next-transition-bar

v1.1.1

Published

Progress-bar component for Next.js app.

Downloads

570

Readme

Next Transition Bar

Elevate the user experience in your Next.js applications effortlessly with next-transition-bar – a versatile npm package designed to seamlessly enhance page transition progress. This lightweight and customizable solution adds a top loader and progress bar, delivering both visual appeal and a smooth transition experience.

Live Demo

Installation

You can install the package using npm:

npm install next-transition-bar

Or if you prefer using yarn:

yarn add next-transition-bar

Usage

Start by importing the package:

import NextTransitionBar from 'next-transition-bar';

Integration with app/layout.js (for app folder structure)

Include <NextTransitionBar /> within the return() statement inside the <body></body> of your RootLayout():

import NextTransitionBar from 'next-transition-bar';

export default function RootLayout({ children }) {
  return (
    <html lang="en">
      <body>
        <NextTransitionBar />
        {children}
      </body>
    </html>
  );
}

Integration with pages/_app.js (for pages folder structure)

To render, add <NextTransitionBar /> within the return() statement in MyApp():

import NextTransitionBar from 'next-transition-bar';

export default function MyApp({ Component, pageProps }) {
  return (
    <>
      <NextTransitionBar />
      <Component {...pageProps} />;
    </>
  );
}

Importing nprogress instance

To import nprogress from 'next-transition-bar':

import { nprogress } from 'next-transition-bar';

or both

import NextTransitionBar, { nprogress } from 'next-transition-bar';

Default Configuration

If no props are passed to <NextTransitionBar />, the package applies the following default configuration:

<NextTransitionBar
  color="#29d"
  initialPosition={0.08}
  trickleSpeed={200}
  height={3}
  trickle={true}
  showSpinner={true}
  easing="ease"
  speed={200}
  shadow="0 0 10px #29d, 0 0 5px #29d"
  template='<div class="bar" role="bar"><div class="peg"></div></div>
            <div class="spinner" role="spinner"><div class="spinner-icon"></div></div>'
  zIndex={1600}
  showAtBottom={false}
  isRTL={false}
  nonce={undefined}
  transformCSS={(css) => <style nonce={undefined}>{css}</style>}
/>
  • color: Change the default color of the top loader.
  • initialPosition: Adjust the initial position of the top loader (in percentage, e.g., 0.08 = 8%).
  • trickleSpeed: Incremental delay speed in milliseconds.
  • speed: Animation speed for the top loader in milliseconds.
  • easing: Animation settings using easing (a CSS easing string).
  • height: Height of the top loader in pixels.
  • trickle: Auto-incrementing behavior for the top loader.
  • showSpinner: Toggle spinner visibility.
  • shadow: A smooth shadow for the top loader (set to false to disable it).
  • template: Include custom HTML attributes for the top loader.
  • zIndex: Define zIndex for the top loader.
  • showAtBottom: Display the top loader at the bottom (increase height to ensure visibility on mobile devices).
  • isRTL: Change the direction of the loader.
  • nonce: The nonce attribute to use for the style tag.
  • transformCSS: This is useful if you want to use a different style or minify the CSS.

Experience a sleek and visually appealing progress bar with next-transition-bar. Customize it to suit your application's unique style and provide users with a delightful journey through your Next.js app.