# Progress ring

> A round progress indicator with the percentage in the middle that springs smoothly to each new value.

- Category: [Loaders](https://library.aimran.es/components/loaders)
- Built with: React + Motion
- Live editor: https://library.aimran.es/blocks/watch-progress-ring
- Library: AIMRAN Library (https://library.aimran.es), free, no sign-up, by Aimran Oukham

## Where to use it

A circular progress bar is ideal when the number itself matters: how complete a user profile is, how much of a course a student has finished or how close someone is to today’s step goal in a fitness app. The ring springs to each new value, much like the activity rings on a smartwatch.

Only use it when you know the real percentage, because a ring that jumps backwards loses people’s trust. One ring per card is enough. Pick a color with good contrast against the grey track, especially on light backgrounds.

## Code

### React (Motion)

```tsx
import { motion } from "framer-motion";

const RADIUS = 42;
const CIRCUMFERENCE = 2 * Math.PI * RADIUS;

interface WatchProgressRingProps {
  color?: string;
  /** Progreso de 0 a 100. */
  progress?: number;
  size?: number;
}

export default function WatchProgressRing({
  color = "#0071e3",
  progress = 72,
  size = 112,
}: WatchProgressRingProps) {
  return (
    <div
      role="progressbar"
      aria-valuenow={progress}
      aria-valuemin={0}
      aria-valuemax={100}
      className="relative grid place-items-center text-[#1d1d1f] dark:text-[#f5f5f7]"
      style={{ width: size, height: size }}
    >
      <svg viewBox="0 0 100 100" className="absolute inset-0 -rotate-90">
        <circle
          cx="50"
          cy="50"
          r={RADIUS}
          fill="none"
          strokeWidth="9"
          className="stroke-black/5 dark:stroke-white/10"
        />
        <motion.circle
          cx="50"
          cy="50"
          r={RADIUS}
          fill="none"
          stroke={color}
          strokeWidth="9"
          strokeLinecap="round"
          strokeDasharray={CIRCUMFERENCE}
          animate={{ strokeDashoffset: CIRCUMFERENCE * (1 - progress / 100) }}
          transition={{ type: "spring", stiffness: 300, damping: 30 }}
        />
      </svg>
      <motion.strong
        key={progress}
        initial={{ scale: 0.8, opacity: 0 }}
        animate={{ scale: 1, opacity: 1 }}
        className="text-xl"
      >
        {progress}%
      </motion.strong>
    </div>
  );
}
```

## Prompt for AI assistants

Paste this into ChatGPT, Claude, Cursor, v0 or Lovable to adapt the block to your stack (Tailwind, Vue, Svelte…):

````text
I want to add the “Progress ring” block (Loaders) from AIMRAN Library to my project.

## What it is
A round progress indicator with the percentage in the middle that springs smoothly to each new value.

## Chosen settings
- Color: #0071e3
- Progress: 72% (from 0 to 100%)
- Size: 112px (from 72 to 150px)

## What I need
1. Add it to my project with the same look and animation as the reference code: same sizes, colours, radii, shadows, timings and easing.
2. It is built with React + TypeScript, with framer-motion for the animation and lucide-react for the icons. If my project uses something else (Vue, Svelte, Astro, plain HTML…), translate it without losing any behaviour. If I use Tailwind, turn the styles into classes; if not, keep the CSS in its own file.
3. Expose the settings above as props (or CSS variables) with those values as defaults.
4. Make it work well on phones: nothing that depends only on hover, touch targets of at least 44 px and no overflow on 320 px screens.
5. Make it look right in light and dark mode.
6. Keep it accessible: semantic HTML, roles and aria-* where needed, visible focus and keyboard support.
7. Respect prefers-reduced-motion: with reduced motion, no big animations but the same end result.

## Reference code
```tsx
import { motion } from "framer-motion";

const RADIUS = 42;
const CIRCUMFERENCE = 2 * Math.PI * RADIUS;

interface WatchProgressRingProps {
  color?: string;
  /** Progreso de 0 a 100. */
  progress?: number;
  size?: number;
}

export default function WatchProgressRing({
  color = "#0071e3",
  progress = 72,
  size = 112,
}: WatchProgressRingProps) {
  return (
    <div
      role="progressbar"
      aria-valuenow={progress}
      aria-valuemin={0}
      aria-valuemax={100}
      className="relative grid place-items-center text-[#1d1d1f] dark:text-[#f5f5f7]"
      style={{ width: size, height: size }}
    >
      <svg viewBox="0 0 100 100" className="absolute inset-0 -rotate-90">
        <circle
          cx="50"
          cy="50"
          r={RADIUS}
          fill="none"
          strokeWidth="9"
          className="stroke-black/5 dark:stroke-white/10"
        />
        <motion.circle
          cx="50"
          cy="50"
          r={RADIUS}
          fill="none"
          stroke={color}
          strokeWidth="9"
          strokeLinecap="round"
          strokeDasharray={CIRCUMFERENCE}
          animate={{ strokeDashoffset: CIRCUMFERENCE * (1 - progress / 100) }}
          transition={{ type: "spring", stiffness: 300, damping: 30 }}
        />
      </svg>
      <motion.strong
        key={progress}
        initial={{ scale: 0.8, opacity: 0 }}
        animate={{ scale: 1, opacity: 1 }}
        className="text-xl"
      >
        {progress}%
      </motion.strong>
    </div>
  );
}
```

Give me the complete final code, ready to paste, and tell me in one line where to put it in my project.
````
