progress-lite
v1.0.2
Published
A lightweight progress bar library inspired by nprogress
Maintainers
Readme
progress-lite 🚀
A lightweight progress bar library like nprogress, built for fun with custom logic and zero dependencies.
Works with React, Vue, vanilla JS, or anywhere in the browser. 🎉
✨ Features
- ⚡ Tiny & dependency-free
- 🎨 Customizable styles
- 🔄 Start, increment, and finish progress easily
- 🛠 Works with any framework
📦 Installation
npm install progress-liteor with yarn:
yarn add progress-lite🚀 Usage
Vanilla JS
import { progress } from "progress-lite"
// Start the progress bar
progress.start()
// Simulate async work
setTimeout(() => {
progress.done()
}, 2000)React Example
import { useEffect } from "react"
import { progress } from "progress-lite"
export default function App() {
useEffect(() => {
progress.start()
setTimeout(() => progress.done(), 1500)
}, [])
return <h1>Hello Progress 🚀</h1>
}⚙️ API
| Method | Description |
|--------------------|--------------------------------------|
| progress.start() | Start the progress bar |
| progress.inc() | Increment progress by random amount |
| progress.done() | Complete and hide the progress bar |
| progress.set(n) | Set progress manually (0 → 1) |
🎨 Custom Styles
The progress bar uses a default CSS.
You can override it:
#progress-lite {
background: linear-gradient(to right, #4facfe, #00f2fe);
height: 4px;
}🧪 Playground
Try it live here 👉 Progress Lite Playground
📝 License
MIT © 2025 viswesh
