Skip to main content

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 ProgressDonut when the indicator must be a small circle.
  • Prefer Skeleton when 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:

ProgressBar.Root└── ProgressBar.Indicator

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.

PropTypeDefaultDescription
maxnumber100The maximum value of the progress bar. Must have a value greater than 0.
valuenumber | "indeterminate"0The current value of the progress bar. Must be between 0 and max; a value outside that range renders as indeterminate. If set to "indeterminate", the progress bar is considered indeterminate.
Data AttributeValueDescription
data-slot"progress-bar"The root element.
data-state"complete" | "indeterminate" | "loading"Set by Radix from value and max.
data-valuethe current valueAbsent while indeterminate.
data-maxthe maximum

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.