Progress Ring

Progress toward a goal as a ring, alone or several nested.

Installation

pnpm dlx shadcn@latest add checkfu/uicontext/radial-chart

Usage

import { ProgressRing } from "./ui/uicontext/components/charts/Radial.ts"
export const SeatsRing = <M>(h: Html.H<M>, used: number, seats: number) =>	ProgressRing(h, { label: "Seats used", value: used, max: seats, caption: "of seats" })

Examples

Nested

Several limits as nested rings, each read as a meter.

  • Workflow runs8,420 / 10K
  • Seats41 / 50
  • Storage, GB62 / 250

API reference

ProgressRingView function

Options

ProgressRing options
NameTypeDefaultDescription
labelrequiredstring——
valuerequirednumber——
maxrequirednumber——
formatChartFormat——
captionstring—Under the share in the middle: "of seats"
sizenumber96Pixels; 96 by default
colorChartColor——
localestring——
styleStyle——

RadialChartView function

Options

RadialChart options
NameTypeDefaultDescription
labelrequiredstring——
ringsrequiredRingDatum[]——
formatChartFormat——
sizenumber140Pixels; 140 by default
localestring——
styleStyle——

Accessibility

  • Each ring is a meter with its value, maximum and a spoken value such as “72 of 100, 72%”.

Source