Progress Component
Progress bar with dynamic width, height, colors, stripes, gradient, and animation. Uses [data-role=bar] for the filled portion and --progress-value or progress-* class for width.
Notes
- Base:
.progress. Set value via style="--progress-value: 60%" , class progress-60 or class progress-[60%].
- The
[data-role=bar] child renders the filled bar. Text inside is centered automatically.
- Use
[data-role=base] for a background label when the bar is too narrow to show text.
- Size:
progress-2xs (4px) to progress-5xl (40px) — default is progress-md (16px).
Basic usage
Using progress-* value class
With [data-role=base] (narrow values)
Sizes
16px (progress-md, default)
Shapes
Theme colors
Primary / Secondary / Tertiary
Highlight / Warning / Caution
Ink / Title / Description / Caption / Disabled
Custom colors
Multiple color formats are supported:
- 1. Theme semantic colors, e.g.
*-error, *-error-hover
- 2. Tailwind built-in colors, e.g.
*-indigo-500
- 3. Raw color values, e.g.
*-[#ff0000]
- 4. CSS named colors, e.g.
*-[red], *-[green]
Stripes
Gradient
progress-gradient (static)
progress-gradient + progress-animated
progress-gradient + progress-animated-reverse
Stripes + Animated
progress-stripes + progress-animated
progress-stripes + progress-animated-reverse
Loading (progress-spinner)
Indeterminate loading (no [data-role=bar] needed)
progress-spinner with different sizes
progress-spinner with different shapes
Use cases
File upload progress
photo.jpg75%
document.pdf45%
video.mp4100%
System resource usage
CPU32%
Memory67%
Disk89%
Password strength
Weak25%
Medium55%
Strong85%