RingChart
Concentric progress rings that sweep in with a stagger. Point at one and the center reads its value. Charts.
Open playground74%
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
npm i @ashutoshswamy/smouiUsage
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.
numberdefault180 / 14- center
Center text when nothing is hovered. Defaults to the average.
{ value: string; label: string }
More charts components
- AreaChartDraws itself in. A guide, dot and tooltip follow the pointer on springs.
- BarChartBars grow in a wave. The pointed bar lights up and its value pops above it.
- BulletChartProgress against a goal. The bar fills on a spring, a tick marks the target, and rows that beat it turn solid.
- BumpChartWho was ahead of whom, step by step. Lines swap places the way rankings do; point at one and it comes forward.
- ContributionGraphA calendar of days as squares, darker for busier ones. They pop in column by column; point at one for its date and count.
- DonutChartRing sweeps in segment by segment. Hover swells a segment and swaps the center.