Skip to content
Charts

Gauge Chart

Radial score. Default and Motion variants.

Examples

Installation

Default is a ready-made wrapper from the registry. Motion is the composable engine at @cronus-ui/ui/charts (peer visx + motion).

bash
npx cronus-ui add gauge-chart
tsx
import { GaugeChart } from "@cronus-ui/ui";

Usage

Motion exports `Gauge` (not GaugeChart). orientation="linear" is a horizontal notch track.

tsx
import { Gauge } from "@cronus-ui/ui/charts";
<Gauge value={72} centerValue={72} defaultLabel="Score" totalNotches={32} />

Components

Motion API — compose these under the chart root. Default wrapper props are in Default API below.

Gauge

Notched arc or linear track. Optional center statistic.

Skip GaugeProps props table
PropTypeDefaultDescription
value*
numberFill level 0–100.
orientation
"arc" | "linear""arc"Arc (default) or horizontal track.
totalNotches
numberNotch count.
spacing
numberFraction of the track reserved for gaps.
useGradient
booleanInterpolate active notches along activeGradient.
centerValue
numberCenter statistic. Omit to hide the label block.
defaultLabel
stringLabel under the value.
prefix
stringPrefix before the number (e.g. $).
suffix
stringSuffix after the number (e.g. %).
labelPlacement
GaugeLabelPlacementLinear gauges only. Arc always overlays center.

Linear gauge

orientation="linear" draws a horizontal notch track. labelPlacement puts the statistic start/center/end.

tsx
<Gauge orientation="linear" value={64} centerValue={64} defaultLabel="Capacity" labelPlacement="end" />

Data format

ts
// No data array — pass a 0–100 value.
<Gauge value={72} centerValue={72} defaultLabel="Score" />

Theming

Motion charts read `--chart-*` aliases that map onto Cronus semantic tokens (`--cronus-chart-1`…`--cronus-chart-5`, `--cronus-border`, `--cronus-fg`, surfaces). Override the aliases or the tokens — never palette scales (`bg-zinc-900`). Default wrappers use `ChartConfig` with `var(--cronus-chart-*)` / `var(--cronus-primary)`. Active notches use the chart ramp / primary; inactive notches use a muted mix of `--chart-grid`.

Full token reference: Theming.

Dependencies

Default needs the recharts peer. Motion needs visx (and sometimes d3) as optional peers — install only what this chart uses.

bash
bun add recharts
bash
bun add motion @visx/responsive

Default API

Generated from the Default wrapper's exported types. Motion subcomponents are documented above.

GaugeChartProps

Extends HTMLAttributes<HTMLDivElement>

Skip GaugeChartProps props table
PropTypeDefaultDescription
value*
number
label
string"Score"
max
number100