Gauge

Displays a single bounded reading as a radial arc.

0%CPU

Configurations

Supported configurations for this component.

Configurations

4 examples
Within limits
0%CPUsm
0%CPUmd
0%CPUlg
Low battery
0%BATTERYsm
0%BATTERYmd
0%BATTERYlg
Critical
0%DISK FREEsm
0%DISK FREEmd
0%DISK FREElg
No readout
sm
md
lg

Add to your project

One command adds this component to your project.

1

Run the following command. New project? Run npx shadcn@latest init first to set up Tailwind and path aliases.

npx shadcn@latest add @aicanvas/••••••••••••

Light and dark both come with the install and follow the dark class on <html>, the shadcn dark mode setup (next-themes with attribute="class").

Props

Every prop this component accepts. Any other prop is forwarded to the underlying element.

PropTypeDefaultDescription
valuenumber0The reading. Clamped to 0..max. Defaults to 0, an empty ring, so the gauge never shows a reading nobody passed.
maxnumber100Full scale — the arc shows value/max.
size'sm'|'md'|'lg''md'One of: sm, md, lg.
thresholds{warning: number, fault: number}-Where this reading stops being healthy, in the same units as `value`. Supply it and the arc colours itself — the preferred form, since a gauge that is TOLD its colour can contradict the number printed inside it. The order carries the direction: `{warning: 70, fault: 90}` is high-is-bad, `{warning: 30, fault: 15}` is low-is-bad. Boundaries are inclusive.
variant'accent'|'warning'|'fault''accent'Arc color by meaning: accent = live/healthy, warning = caution, fault = danger. The manual fallback, for a gauge with no meaningful threshold; `thresholds` wins.
unitstring'%'Suffix after the readout, muted + smaller. Pass '' for a unitless reading.
labelstring-Optional code label below the value inside the circle (sans xs, muted, uppercase). Centered when showValue is false.
showValuebooleantrue-
ariaLabelstring-Overrides the generated "<label or Gauge> <value> of <max><unit>" description.
classNamestring-Additional CSS classes applied to the root element.
styleReact.CSSProperties-Inline styles applied to the root element.

More Andromeda Pro components