Skip to main content

Progress Donut

Displays an indicator showing the completion progress of a task as a circular progress bar. Give ProgressDonut.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 small circle.
  • Prefer ProgressBar when the indicator is a horizontal bar.

Indicator color

The indicator color is inherited via currentColor. Override the default (accent-600) by setting the ProgressDonut.Indicator's text color.

With a label

Put a short label beside a small donut to show the usage of each item in a list.

Accessibility

ProgressDonut.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".

Indeterminate value

Set the value prop to "indeterminate" to show the donut in an indeterminate state.

Control the rotation speed with the indeterminateRotationSpeed prop.

Dynamic colors

ProgressDonut.Indicator inherits its color from the parent text color through currentColor. Set the parent's text color to change the indicator based on the current progress value.

Composition

Compose the parts of a ProgressDonut together to build your own:

ProgressDonut.Root└── ProgressDonut.Indicator

API Reference

ProgressDonut.Root

A simple circular progress bar which shows the completion progress of a task.

The indicator color is inherited via currentColor. Override the default (accent-600) by setting the ProgressDonut.Indicator's text color.

The ProgressDonut accepts the following props in addition to the standard HTML svg attributes.

PropTypeDefaultDescription
indeterminateRotationSpeed`animation-duration-${string}`"animation-duration-[15s]"Controls the rotation speed of the indeterminate spinner state, as a Tailwind animation-duration-* class.
maxnumber100The maximum value of the progress bar. Must have a value greater than 0.
strokeWidthnumber | `${number}rem`"0.25rem"The width of the progress bar stroke, clamped between 1px and 12px.
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-donut"The root <svg>.
data-valuethe current valueAbsent while indeterminate.
data-min0
data-maxthe maximum

ProgressDonut.Indicator

The indicator for the circular progress bar.

All props from svg g.