Skip to main content

ProgressRing

import { ProgressRing } from "@study/ui"

Result
Loading...
Live Editor
function Example() {
  const [v, setV] = useState(0.62);
  return (
    <div style={{ display: "flex", gap: 20, alignItems: "center" }}>
      <ProgressRing value={v} label={`${Math.round(v * 100)} percent done`} size={104} thickness={12} tone="petrol">
        <span style={{ fontSize: 24 }}>{Math.round(v * 100)} %</span>
      </ProgressRing>
      <input type="range" min="0" max="1" step="0.01" value={v} onChange={(e) => setV(+e.target.value)} aria-label="Value" />
    </div>
  );
}

Variants and states​

Light

85

Dark

85

When to use​

  • Progress of a course, a study session, an upload of known size.
  • On course colours with onTint – then the track is white.
  • animateKey: the ring runs up the first time it appears in a visit, afterwards it stands still.
  • Unknown duration? Then Spinner.

Props​

PropTypeDefaultMeaning
label *string–Said to screen readers, e.g. "8 of 13 chapters".
value *number–How far, from 0 to 1.
animateKeystring–Runs up from zero the first time a ring with this key appears in a visit.
childrenReactNode–Inside the ring, e.g. the percentage.
classNamestring–
onTintboolean–On a tinted card the track is white; elsewhere it is the sunken grey.
sizenumber48Width and height in px.
thicknessnumber6
tone"blau" | "petrol" | "gruen" | "gelb" | "orange" | "rot" | "violett" | "grau"blau

Accessibility​

  • An image with label as its description – say the number in words there ("8 of 13 chapters").
  • The colour strong is light; so the number is always also there as text next to it or inside.