Progress Ring

Animated

A radial progress arc, determinate or indeterminate.

Source
$npx @dinachi/cli@latest add progress-ring
value
size
showValue
label

Usage

import { ProgressRing } from "@/components/ui/progress-ring"

export function Upload() {
  return <ProgressRing value={64} label="Upload" />
}

Examples

Press the buttons quickly and watch the spring re-target.
import { ProgressRing } from '@/components/ui/progress-ring';

export function Example() {
  return <ProgressRing value={64} label="Upload" />;
}

Notes

Motion tier

Needs motion. add --all skips it; install with add --motion or by name.

Value changes

The arc springs to each new value from wherever it is, so rapid updates merge into one sweep. The centre number follows the same spring, shared with number ticker.

Indeterminate

Omit value for an arc that lengthens and shortens while it rotates.

When to use it

  • One operation being waited on, such as an upload, import or quota, or a compact spot with no room for a bar.
  • For progress per row in a list, use Progress. The arc animates stroke-dashoffset, which repaints.
  • Avoid it under about 40px, where the number stops fitting.

Agent

ProgressRing does not register with the agent bridge. The bridge reads it from the accessibility tree as progress with value, min and max, and no actions. While indeterminate it is a status and is not listed.

agent.snapshot()
// [{ component: "progress", label: "Upload", value: 64, min: 0, max: 100, actions: [] }]

API

value
agent
number
0 to 100. Omit it for the indeterminate arc.
label
agent
string = "Progress" or "Loading"
The accessible name, also read by the agent.
sizenumber = 96
Outer diameter, in pixels.
thicknessnumber
Stroke width in pixels. Scales with size by default.
showValueboolean = true
Shows the percentage. Ignored when indeterminate.

Accessibility

  • A determinate ring is a progressbar with aria-valuenow, aria-valuemin, aria-valuemax and aria-valuetext, such as "64 percent".
  • An indeterminate ring is a status with no value.
  • label is the accessible name; defaults to "Progress" or "Loading".
  • The centre number is aria-hidden; the ring announces the value.
  • Reduced motion jumps to the value and shows a static gap instead of the sweep.