• Stars
    star
    704
  • Rank 64,316 (Top 2 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created over 1 year ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Next.js Top Loading Bar component made using nprogress, works with Next.js 14 , Next.js 13 and React.

Next Js TopLoader

  • A Next.js Top Loading Bar component made using nprogress, works with Next.js 14 and React.

NPM NPM Downloads

Install

using npm:

npm install nextjs-toploader

using yarn:

yarn add nextjs-toploader

Usage

import using:

import NextTopLoader from 'nextjs-toploader';

Usage with app/layout.js for app folder structure

For rendering add <NextTopLoader /> to your return() inside the <body></body> of RootLayout():

import NextTopLoader from 'nextjs-toploader';

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

Usage with pages/_app.js for pages folder structure

For rendering add <NextTopLoader /> to your return() in MyApp():

import NextTopLoader from 'nextjs-toploader';

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

Usage with React, Vite React or any other React Based Framework

For rendering add <NextTopLoader /> to your return() inside the component in App() in your App.js:

import NextTopLoader from 'nextjs-toploader';
const App = () => {
  return (
    <div>
    <Router>
      <NextTopLoader />
    <Routes>
    {/* Your Routes Here */}
    </Routes>
    </Router>
    </div>
  )
}

export default App;

Default Configuration

If no props are passed to <NextTopLoader />, below is the default configuration applied.

<NextTopLoader
  color="#2299DD"
  initialPosition={0.08}
  crawlSpeed={200}
  height={3}
  crawl={true}
  showSpinner={true}
  easing="ease"
  speed={200}
  shadow="0 0 10px #2299DD,0 0 5px #2299DD"
  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}
/>
  • color: to change the default color of TopLoader.
  • initialPosition: to change initial position for the TopLoader in percentage, : 0.08 = 8%.
  • crawlSpeed: increment delay speed in ms.
  • speed: animation speed for the TopLoader in ms
  • easing: animation settings using easing (a CSS easing string).
  • height: height of TopLoader in px.
  • crawl: auto incrementing behavior for the TopLoader.
  • showSpinner: to show spinner or not.
  • shadow: a smooth shadow for the TopLoader. (set to false to disable it)
  • template: to include custom HTML attributes for the TopLoader.
  • zIndex: defines zIndex for the TopLoader.
  • showAtBottom: To show the TopLoader at bottom. (increase height for the TopLoader to ensure it's visibility at the mobile devices)

UPI ID: thesgj@sbi

Sponsor me on GitHub

"Buy Me A Coffee"

More Repositories

1

ManOfOutbreak-Unity

Man Of Outbreak, Mobile FPS Game made using unity.
ShaderLab
9
star
2

TheSGJ

Config files for my GitHub profile.
7
star
3

PyScript-ReplSite

Integrated Python Repl/IDE made using PyScript.
HTML
6
star
4

grm

HTML
5
star
5

TextMagic-React

TextMagic is React app which is used to analyse and manipulate your text.
JavaScript
5
star
6

TodoList-ReactStatic

Static Website/Files for Todo list made with React js
HTML
5
star
7

rileyghost

Website for Discord Bot riley ghost
HTML
5
star
8

TodosList-React

TodosList Website using React js, using various react components and react router v5.
JavaScript
5
star
9

CelestialGeek-Tailwind-Website

CelestialGeek-Tailwind-Website
HTML
5
star
10

2-js-projects

2 vanilla javascipt projects to advance your javascript skills. First one is a Digital Clock and the second one is the todos list website.
HTML
5
star
11

Rigel-Grin-Website-Bootsrap

Rigel Grin Website made with HTML5 CSS & Bootstrap CDN.
HTML
4
star
12

Simple-Flask-Api

Simple Api using flask.
Python
4
star
13

the-sgj

JavaScript
4
star
14

Guessing-Number-Game-Python

This is a game where you guess a random number between 1 and 50!
Python
4
star
15

temp-conv-python

Simple Python code to convert Fahrenheit to Celsius & Celcius to Fahrenheit by creating a function.
Python
4
star
16

Snake-Game

Python
4
star
17

CelestialGeek

Celestial geek static website.
HTML
4
star
18

RigelGrin-Bootstrap5-Website

RigelGrin Bootstrap5 Website
HTML
4
star
19

tc-news-fetcher-express

JavaScript
3
star
20

tp-processor-api

tp-processor-api retrieves list of processors for pc by using web scraping by the help of library named cheerio.
JavaScript
3
star
21

TheSGJ.github.io

HTML
3
star
22

cotart-gpt

Cotart GPT AI ChatBot is a website similar to ChatGPT made using OpenAI API and text-davinci-003 AI model
JavaScript
3
star
23

SteinsGate-GameBoy

Assembly
3
star
24

deca-notes-backend

This is a repository for the backend server api made using express js & MongoDB by using mongoose in node js.
JavaScript
3
star
25

decaNotes-React

JavaScript
3
star
26

zeta-astronomy

Zeta Astronomy a site made by next js for Astronomers to show them the most beautiful pictures of Galaxies, Nebula and more. These are best Astronomical Image, this of all time. These beautiful pictures are taken by Hubble Space Telescope.
JavaScript
3
star
27

TextMagic-ReactNative

TextMagic App made using React Native expo.
JavaScript
2
star
28

kanpeki-music

Dart
2
star
29

TrappistWeather-ReactNative

Trappist weather app which will show weather using a weather api. Supports both Android & iOS.
Java
2
star
30

dsa-python-jupyter

Repository for Data structures & algorithms in Python by using Jupyter Notebooks
Jupyter Notebook
2
star
31

TenkiWeather-Maui

C#
2
star
32

usefull-pwsh-scripts

This contain some usefull powersehll scripts in order to automate every command according to your needs. Add this folder to your Environment Variables in order to access these scripts easily..
PowerShell
2
star
33

TextMagic-ReactNative-WebViewApp

Text Magic App Made using React Native, which uses WebView to render the TextMagic Website on the App.
JavaScript
2
star
34

counter-loop-cpp

A simple loop code in C++ for counting number to a nth term.
C++
2
star
35

Pegasi-Blog

Pegasi Blog, a Blog website made using next js
2
star
36

TM-Mobile_ViteReact

JavaScript
2
star
37

cele-hugo-rgs

CSS
2
star
38

service-tw-react

Service TW is Website made by React js & tailwind css for the service based company demo website.
JavaScript
2
star
39

ssh_vm-bash-script

Bash Script to ssh into the vm. This can be used if you configured password less login on your computer.
Shell
2
star
40

cotart-gpt-server

Cotart GPT Server uses OpenAI API and text-davinci-003 AI model to run backend server using express js
JavaScript
2
star
41

Trappist-News-React

Trappist News a news website, made using React Js class based & It shows the latest news from the different news platforms. It uses newsapi.org API to provide news just by fetching news data from an API endpoint.
JavaScript
2
star
42

tuf-codegists

JavaScript
2
star
43

tuf-codegists-frontend

JavaScript
2
star
44

Trappist-News-React-Functional

Trappist-News-React-Function-Component is remake Trappist News with React Functional Based Components.
JavaScript
2
star
45

MauiApplication

C#
1
star
46

dotfiles

Lua
1
star
47

Calculator-Java_AndroidApp

Java
1
star
48

MusicStream-JetpackCompose

Kotlin
1
star
49

add-ints

CALCULATE THE SUM FOR ANY TWO INTEGERS IN PYTHON!
Python
1
star
50

HibiNotes-JetpackCompose

Kotlin
1
star
51

rocket-api

Rust
1
star
52

calendar-android

Java
1
star
53

JetpackComposeAndroid-App

Kotlin
1
star
54

cpp-nvim-config

Lua
1
star
55

django-auth-backend-api

Authentication Backend API made using the Python Django & Django Rest Framework.
Python
1
star
56

cointoss-fortran

This program implements a simple coin tossing game where the user guesses the outcome of a coin toss. The game should toss a coin 1 times and add the score.
Fortran
1
star