Overview
Popui provides two progress components:ProgressBar for linear progress indicators and ProgressBarCircle for circular progress rings. Both support percentage-based and current/total-based progress tracking.
ProgressBar
Basic Usage with Percentage
With Current and Total
Warning Threshold
The progress bar changes to yellow when reaching the warning threshold:Critical State (100% or Over)
The progress bar turns red when at or exceeding 100%:Overage Display
When usage exceeds the total andallowOverage is enabled, the bar shows both used and overage:
- A primary bar showing the base usage (up to 100%)
- A yellow overage bar showing the excess usage
Prevent Overage Display
allowOverage={false}, the bar displays as fully red at 100% even when current exceeds total.
ProgressBarCircle
Basic Usage
The
progress prop for ProgressBarCircle is a decimal between 0 and 1 (e.g., 0.65 for 65%).Dark Variant
Different Sizes
Usage in Counter Widgets
ProgressBar Props
Progress as a percentage (0-100). Cannot be used with
current and total.Current value. Must be used with
total. The percentage is automatically calculated as (current / total) * 100.Maximum value. Must be used with
current.When
true and current > total, displays the overage as a separate yellow segment. When false, treats values over 100% as critical (red) at 100%.Percentage threshold at which the bar turns yellow (warning state). Must be less than 100.
ProgressBarCircle Props
Progress as a decimal between 0 and 1 (e.g., 0.65 for 65%).
Diameter of the circle in pixels.
Color variant:
'default'- Uses standard theme colors'dark'- Uses inverse/dark theme colors for light backgrounds
Color States (ProgressBar)
The linear progress bar automatically changes color based on progress:| State | Condition | Color |
|---|---|---|
| Normal | percentage < warningPercentage | Blue/default (bg-icon-inverse-bold) |
| Warning | percentage >= warningPercentage && percentage < 100 | Yellow (bg-background-warning-inverse) |
| Overage | current > total with allowOverage={true} | Primary blue + yellow overage |
| Critical | percentage >= 100 or over limit without overage | Red (bg-background-critical-inverse) |
Overage Calculation
WhenallowOverage={true} and current > total:
- overagePercentage = (20/120) * 100 ≈ 16.67%
- usedPercentage = 83.33%
- Visual: 83.33% blue bar + 16.67% yellow bar
Styling Details
ProgressBar Layout
- Height: 4px (h-1)
- Container: Full width flex with 2px gap between segments
- Shape: Rounded with
rounded-full - Background: Light gray for remaining portion (
bg-background-selected-inverse)
ProgressBarCircle Styling
The circular progress uses CSS conic-gradient and mask for the ring effect:- Ring thickness: 1.5px
- Smooth rotation animation (500ms ease-in)
- Circular clip path using radial-gradient mask
Accessibility
- Progress values are visually distinct through color and size
- Color is not the only indicator (percentage/values should be shown separately)
- Sufficient contrast ratios for all color states
- Consider adding ARIA labels for screen readers:
Use Cases
ProgressBar
- API quota usage tracking
- Storage space indicators
- Upload/download progress
- Task completion tracking
- Subscription limits
ProgressBarCircle
- Compact space indicators
- Profile completion status
- Loading states
- Circular gauges
- Small widgets and badges
TypeScript
Both components are fully typed:Related Components
- StatusLabel - For discrete status states
- Notification - For status messages
- TagStatus - For colored status badges