百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
N

next13-progressbar

> 前端框架
开源

一个使用 NProgress 的简单 Next.js 进度条组件,支持 Next.js >=13 的应用目录。

99 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

一个使用 NProgress 的简单 Next.js 进度条组件,支持 Next.js >=13 的应用目录。

Next.js 13 Progressbar

A simple Next.js progressbar component using NProgress with support of next.js 13 and later app dir.

Demo: https://next13-progressbar.vercel.app/

How to install?

bash
npm i next13-progressbar

How to use?

⚠️ Note : This docs are for versions >=1.0.0 only. For the older versions check tags versions tree's Readme of the older version.

After installing the package, create providers.tsx file in app directory to handle contexts and mark it use client. see contexts in app dir and import `Next13ProgressBar;

javascript
'use client';
import React from 'react';
import { Next13ProgressBar } from 'next13-progressbar';

const Providers = ({ children }: { children: React.ReactNode }) => {
  return (
    <>
      {children}
      
    
  );
};

export default Providers;

Wrap your providers in layout.tsx/js

javascript
import Providers from './providers';

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    
      
        {children}
      
    
  );
}

By default all a tags are handled by next/link so you don't need to do anything.

javascript
import Link from 'next/link';
import { useRouter } from 'next13-progressbar';

const NavBar = () => {
  const router = useRouter();
  return (
    

  );
};

Default Config

If no props are passed to ``, below is the default configuration applied.

javascript
  • color: to change the default color of progressbar. You can also use rgb(,,) or rgba(,,,).
  • startPosition: to set the default starting position : 0.3 = 30%.
  • delay: time for delay to start progressbar in ms.
  • stopDelayMs: time for delay to stop progressbar in ms.
  • height: height of progressbar in px.
  • showOnShallow: You can choose whether you want the progressbar to be displayed if you're using shallow routing. It takes a boolean. Learn more about shallow routing in Next.js docs.

Advanced Config

Adding nonce

We use internal css in this package. If you are using csp, you can add nonce to the tag by providing `nonce` prop to component.

javascript

Custom CSS

You can pass custom css to the progressbar by using style prop.

javascript

Older Versions

Check Branches with v prefix for older docs of the package. If not found check tags versions tree's Readme of the older version.

Contributing

Any Contribution of any kind are appreciated. You can start by forking this repository and make your changes then submit a pull request

Author

  • Ndungutse Charles

Support

Your support matters. It pushes me to do more Open Source contributions and give back to the community.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScriptapp-router-nextjsappdirnextjs13nprogress

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类前端框架
定价开源

> 相关工具

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架