$ ProgressBar
animatedgradient
Animated progress bars with gradient colors, percentage display, item counts, and ETA calculation.
# Preview
progressbar demo
Installing █████████████████████████░░░░░░░░░░░░░░░ 65% 65/100 ETA 1.2s
Building ████████████████████████████████████████ 100% 100/100
✔ Build complete!
# Usage
example.ts
import { ProgressBar } from "@vr_patel/tui";
const bar = new ProgressBar({
total: 100,
width: 40,
title: "Downloading",
gradient: true, // red → yellow → green
showETA: true,
});
bar.start();
for (let i = 0; i <= 100; i++) {
bar.update(i);
await sleep(30);
}
bar.finish("Download complete!");# API
| Prop | Type | Default | Description |
|---|---|---|---|
| total | number | 100 | Total number of items |
| width | number | 40 | Width of the bar in characters |
| title | string | "" | Label shown before the bar |
| gradient | boolean | true | Enable red → yellow → green gradient |
| showPercentage | boolean | true | Show percentage after bar |
| showCount | boolean | true | Show current/total count |
| showETA | boolean | true | Show estimated time remaining |
| barColor | string | fg.cyan | Color when gradient is off |
| completeChar | string | "█" | Filled bar character |
| incompleteChar | string | "░" | Empty bar character |