Skip to content
ProLifetime access for $199, paid once, every future release included
Truffle UI

Progress Ring

Free

A circular progress bar that springs to its value.

Installation

pnpm dlx shadcn@latest add @viewport/progress-ring

First time? Add the @viewport registry to components.json. Setup takes one minute.

Usage

The code behind the preview above.

progress-ring-demo.tsx
"use client";

import { useState } from "react";
import { ProgressRing } from "@/components/viewport/progress-ring";

export default function ProgressRingDemo() {
  const [value, setValue] = useState(64);
  return (
    <div className="flex flex-col items-center gap-6">
      <ProgressRing value={value} label="Storage used" size={128} thickness={10} />
      <div className="flex gap-2">
        {[12, 64, 100].map((v) => (
          <button
            key={v}
            onClick={() => setValue(v)}
            className="rounded-md border border-border px-3 py-1 text-xs font-medium outline-none transition-colors hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring"
          >
            {v}%
          </button>
        ))}
      </div>
    </div>
  );
}

Props

PropTypeDefault
value*number

Current value, between 0 and `max`.

—
maxnumber100
sizenumber

Diameter in pixels.

96
thicknessnumber

Stroke width in pixels.

8
label*string

Accessible name, e.g. "Storage used".

—
showValueboolean

Show the percentage in the center.

true
classNamestring—

Accessibility

  • Exposed as role=progressbar with min, max and current values.
  • Requires a `label` for its accessible name.
  • Jumps to the value under reduced motion.