Officina UI
Components

Gauge

Compact SVG gauge showing a single value as an arc, semicircle, or linear bar.

Gauge is a lightweight, dependency-free SVG dial for a single value — handy for KPI tiles and dashboards showing things like CPU or memory usage. Pass a value (clamped between min/max, default 0–100) and pick a variant: arc, semi, or linear. Set size, a label, thresholds to switch colour as the value crosses stops, or formatValue to add a unit. Unlike GaugeChart it renders inline SVG, so no chart canvas or explicit height is needed.

Example

Preview
import { Gauge } from '@officina/ui';

<Gauge value={72} label="CPU" size={140} />
<Gauge value={58} variant="semi" label="Memory" size={140} />;

API

PropTypeDefaultDescription
value*number—Current value to display.
formatValue(value: number) => string—Format the displayed value (e.g. add a unit).
labelstring—Caption shown with the value.
maxnumber100Upper bound of the scale. Defaults to 100.
minnumber0Lower bound of the scale. Defaults to 0.
sizenumber160Diameter (arc/semi) or width (linear) in pixels.
thresholds{ value: number; color: string; }[]—Threshold stops — color switches when value crosses. Sorted ascending.
trackColorstringvar(--color-bg-muted)Colour of the unfilled track.
variantenumarcVisual style: arc (270° dial), semi (180° half circle), linear (horizontal bar).

On this page