Progress Bar
Displays an indicator showing the completion progress of a task as a linear progress bar with customizable colors. Give ProgressBar.Root an aria-label, or a screen reader announces a bare "progress bar".
When to use
- Show how much of a task or a quota is complete, as a horizontal bar.
- Prefer
ProgressDonutwhen the indicator must be a small circle. - Prefer
Skeletonwhen the content still loads, and its progress is unknown.
Indicator color
The indicator is bg-accent-600 by default. Set another background color on ProgressBar.Indicator with className.
With a label
Put a short status label beside a narrow bar to show the state of each item in a list.
Accessibility
ProgressBar.Root renders role="progressbar" with aria-valuemin, aria-valuemax, and aria-valuenow, and omits aria-valuenow while indeterminate. The role needs a name: pass aria-label, or aria-labelledby that points at a visible label, or a screen reader announces a bare "progress bar".
Custom maximum value
Set a custom maximum value with the max prop. The progress bar renders the value as a percentage of that maximum.
Indeterminate value
Set the value prop to "indeterminate" to show the progress bar in an indeterminate state. Currently, this displays as a progress bar at 0% but keeps accessibility attributes for screen readers.
Dynamic colors
Set the color of the ProgressBar.Indicator with the className prop to change colors based on the current progress value or application state.
Composition
The progress bar consists of an indicator (filled portion) that shows the current progress value against a background container. Compose the parts of a ProgressBar together to build your own:
API Reference
ProgressBar.Root
A linear progress bar that displays completion progress with customizable colors.
The ProgressBar.Root accepts the following props in addition to the standard HTML div attributes.
ProgressBar.Indicator
The indicator portion of the progress bar that shows the completed progress. It positions itself from the current value relative to max.
All props from HTML div element.