StealThis .dev

Progress Ring

A circular SVG progress indicator with animated stroke-dashoffset, percentage label, configurable size/stroke, and support for multiple simultaneous rings with distinct colors and labels.

Open in Lab
svg css react tailwind vue svelte
Targets: TS JS HTML React Vue Svelte

Code

Features

  • Animated stroke — smooth stroke-dashoffset transition from 0 to target
  • Percentage label — animated counter ticks up inside the ring
  • Configurable — size, stroke-width, color, and duration via CSS variables
  • Multiple rings — stack several rings independently
  • Color variants — accent, success, warning, danger presets

How it works

  1. Ring circumference = 2π × radius
  2. stroke-dasharray is set to the full circumference
  3. stroke-dashoffset is animated to circumference × (1 - progress) for the filled arc
  4. A counter animation increments the displayed number in sync