RingChart

Concentric progress rings that sweep in with a stagger. Point at one and the center reads its value. Charts.

Open playground
74%
Average
  • Move78%
  • Exercise52%
  • Stand91%

About

RingChart is a React component in the Charts category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { RingChart } from "@ashutoshswamy/smoui" and set rings, size, center.

Install

Terminal
npm i @ashutoshswamy/smoui

Usage

TSX
import { RingChart } from "@ashutoshswamy/smoui";

<RingChart rings={[{ label: "Move", value: 78 }, { label: "Stand", value: 91, max: 100 }]} />

Props 3

rings

Outer ring first. max defaults to 100.

{ label: string; value: number; max?: number }[]
size / thickness

Px.

numberdefault 180 / 14
center

Center text when nothing is hovered. Defaults to the average.

{ value: string; label: string }