shadcn.io is not affiliated with official shadcn/ui
Progress examples · Colored
Danger Progress for React
A progress bar at 25 percent in the destructive color, for a task that is failing or critical.
A progress bar in the theme's destructive color, for an upload that keeps failing or a quota that is nearly used up. Pair the color with text that says what is wrong.
Preview
Installation
FAQ
How is the bar colored?
With classes on Progress, since it has no color prop. **:data-[slot=progress-indicator]:bg-destructive colors the fill, which sits inside the track.
*:data-[slot=progress-track]:bg-destructive/20 tints the track.
How do I go back to the default colors?
Remove the two color classes. The fill goes back to bg-primary and the track to bg-muted.
Does 25 pick the color?
No. value only sets the amount; the color classes apply at any value. Change them yourself when the state changes, such as when an upload fails.
What is the accessible name?
aria-label on Progress, Upload progress. The demo has no visible label, so without it a screen reader would announce a bar with no name.
Related
- Warning ProgressA progress bar at 50 percent in the
- Success ProgressA progress bar at 70 percent in the
- Quarter ProgressA progress bar at 25 percent, early in
- Error with Title AlertA destructive alert with only a title
- Info ProgressA progress bar at 60 percent in the info
- Gradient ProgressA progress bar at 65 percent whose fill