Giter VIP home page Giter VIP logo

devmahmud / next-transition-bar Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 1.85 MB

Effortlessly enhance Next.js apps with next-progress-bar – an npm package for smooth page transition progress. Customizable, lightweight, and visually appealing, it adds a top loader and progress bar. Elevate user experience seamlessly.

Home Page: https://next-transition-bar.vercel.app

License: MIT License

TypeScript 98.20% CSS 0.23% JavaScript 1.58%
nprogress app-router next-nprogress nextjs progressbar react-nprogress topbar-progress indicator loading top

next-transition-bar's Introduction

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.

next-transition-bar's People

Contributors

dependabot[bot] avatar devmahmud avatar

Stargazers

 avatar

Watchers

 avatar

next-transition-bar's Issues

The automated release is failing 🚨

🚨 The automated release from the main branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you can benefit from your bug fixes and new features again.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can fix this 💪.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the main branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here are some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


Cannot push to the Git repository.

semantic-release cannot push the version tag to the branch main on the remote Git repository with URL https://[secure]@github.com/devmahmud/next-transition-bar.git.

This can be caused by:


Good luck with your project ✨

Your semantic-release bot 📦🚀

The automated release is failing 🚨

🚨 The automated release from the main branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you can benefit from your bug fixes and new features again.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can fix this 💪.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the main branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here are some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


Cannot push to the Git repository.

semantic-release cannot push the version tag to the branch main on the remote Git repository with URL https://[secure]@github.com/devmahmud/next-transition-bar.git.

This can be caused by:


Good luck with your project ✨

Your semantic-release bot 📦🚀

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.