Progress ring
The Progress bar drawn round: one value out of a total, on a tint of its own color; or two or three parts that fill the circle.
<ProgressRing aria-label="Probes graded" value={62} max={100} />Installation
import { ProgressRing } from "@dome-systems/ds-dashboard/components";A value out of a total
One value out of max: an arc with round ends, from the top and clockwise, on a track of its own color at 35%.
<ProgressRing aria-label="Tokens used" value={120} max={250} color="info" /><ProgressRing aria-label="Tokens used" value={250} max={250} color="error" />Parts
Two or three parts, clockwise from the top in order, in success, error or info. They always fill the whole circle, 1px apart, with no track, so the ring stays unnamed: its numbers go beside it.
<ProgressRing parts={[{ value: 4, color: "success" }, { value: 1, color: "error" }]} /><ProgressRing parts={[{ value: 48, color: "info" }, { value: 30, color: "success" }, { value: 22, color: "error" }]} />Sizes
sm 12px with a 3px stroke, md 16px with 3.5px, lg 20px with 4px.
<ProgressRing aria-label="Progress" size="sm" value={62} max={100} /><ProgressRing aria-label="Progress" size="md" value={62} max={100} /><ProgressRing aria-label="Progress" size="lg" value={62} max={100} />Accessibility
Named with aria-label, it is a progressbar: a screen reader hears its name and how far along it is. Unnamed, it is decoration (aria-hidden), for numbers beside it that say the same. Parts always fill the ring, so a screen reader would only hear 100%: leave a ring of parts unnamed, with its numbers beside it.
API Reference
Besides these, the props of Base UI's Progress.Root.
| Prop | Type | Default | Description |
|---|---|---|---|
value | number | — | One value, over a track of its color. |
color | "neutral" | "primary" | "success" | "warning" | "error" | "info" | "fuchsia" | "info" | The value's color, and its track's at 35%. |
max | number | — | What the value is out of. By default the value itself, so it fills the ring. |
parts | [part, part] | [part, part, part], each { value: number; color?: "success" | "error" | "info" } | — | Two or three parts in place of a value; they always fill the ring. |
size | "sm" | "md" | "lg" | "md" | 12px with a 3px stroke, 16px with 3.5px, or 20px with 4px. |
Rules
Written down
The Progress bar's sibling
Its props, colors and arithmetic are the Progress bar's; only the drawing is round.
From ds/README.md (Progress ring).
Parts fill the ring
Two or three parts always make the whole circle, 1px apart: no track, no max.
From ds/README.md (Progress ring) and ds/components/progress-ring.tsx.
No pie yet
A pie is not built: it waits for a screen that needs one.
From ds/README.md (Progress ring).