progress-ring
CSS-only circular progress indicator with size and color variants.
Overview
The <progress-ring> element displays a circular progress indicator using pure CSS (conic-gradient + mask). Set the progress value via the --progress custom property (0–100).
Attributes
| Attribute | Values | Default | Description |
|---|---|---|---|
data-size |
xs, s, m, l, xl |
m |
Ring size. |
data-variant |
success, warning, error |
interactive | Color variant. |
data-indeterminate |
boolean | — | Shows a spinning indeterminate animation. |
Sizes
Color Variants
Indeterminate
Add data-indeterminate for a spinning animation when the progress value is unknown.
Updating with JavaScript
Update the --progress property dynamically. Remember to also update aria-valuenow.
Custom Properties
| Property | Default | Description |
|---|---|---|
--progress |
0 |
Progress value (0–100). |
--progress-ring-size |
4em |
Ring diameter. |
--progress-ring-width |
0.35em |
Ring track thickness. |
--progress-ring-color |
interactive | Filled arc color. |
--progress-ring-track |
15% of color | Background track color. |
Accessibility
- Add
role="progressbar"witharia-valuenow,aria-valuemin,aria-valuemaxfor determinate progress. - For indeterminate, add
aria-label="Loading"instead. - Animation slows under
prefers-reduced-motion: reduce. - CSS-only: works without JavaScript.
Related Elements
<loading-spinner>— Indeterminate loading animation<progress>— Native linear progress bar<meter>— Native gauge/meter element