Overview
TheProgressBar component displays visual progress with smooth animations. It supports both single and multiple progress values, customizable colors, animation timing, and an optional floating percentage indicator.
Import
Usage
Basic Progress Bar
With Percentage Display
Animated Progress
Custom Color
Multiple Progress Bars
Custom Range
Custom Height
Props
Current progress value(s).Single value:Multiple values:When using multiple values, each segment gets its own color and percentage indicator.
Minimum value for progress calculation. Used to calculate the percentage:
Maximum value for progress calculation.
Bar color. Overrides the default primary color.Default:
Color.background.primaryAnimation duration in seconds for progress changes.
Delay in seconds before animation starts.
Display floating percentage badge(s) above the progress bar.The badge:
- Automatically positions above the current progress point
- Matches the bar color (or uses custom color)
- Shows percentage with 0 decimal places
- Appears for each segment in multi-progress mode
Custom inline styles for the container. Common use cases:
Features
- Smooth animations: CSS transitions with configurable timing and delay
- Multiple progress bars: Display several progress segments simultaneously
- Percentage display: Optional floating badge showing exact percentage
- Custom ranges: Support for non-0-100 ranges
- Color customization: Per-bar color control
- Responsive: Works across all screen sizes
- Accessible: Uses
role="progress-bar"for semantic identification
Animation Behavior
The progress bar uses CSS transitions for smooth animations:- Initial render: Starts at 0 (or last progress value)
- Progress change: Smoothly transitions to new value
- Timing: Controlled by
animationTimeprop (ease-out) - Delay: Optional delay before animation starts
Multi-Progress Mode
When passing an array of progress values:- Each segment renders side-by-side
- Segments share the same container (stacked horizontally)
- Each can have its own color
- Each gets its own percentage badge when
showPercentage={true} - Total width is sum of all segments as percentage of maxValue
Design Specifications
- Default height: 6px
- Background:
Color.background.soft(light gray) - Border radius: 100px (fully rounded ends)
- Default color:
Color.background.primary - Percentage badge:
- Background:
ColorV2.surface.primary(or custom color) - Text: White, p2 size, medium weight
- Padding: 0px 4px
- Border radius: 4px
- Position: 28px above bar, centered on progress point
- Background:
Best Practices
- Use
showPercentagefor important progress indicators - Add animation for dynamic progress changes (loading, uploads)
- Use multiple progress bars to show segmented completion (e.g., task categories)
- Keep
animationTimebetween 0.5-2 seconds for natural feel - Use custom colors to indicate progress state (green=success, red=danger)
- Ensure sufficient contrast between bar color and background
- Consider custom height for better visibility in your design
Accessibility
- Uses
role="progress-bar"for semantic identification - Percentage display provides clear progress indication
- Visual progress complemented by numeric percentage
- High contrast default colors