Gauge
A panel meter for one reading on a fixed scale: load, temperature, a score out of 100. Use it when the reader needs to see how close a value is to a limit. For progress towards a goal, use the ring meter; for a quota, the usage meter.
Install
npx shadcn@latest add @thrum-pro/gaugeThis is a Pro component. The command works once your project has a licence key: set up Pro or see pricing.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
value | number | null | Required | The reading. null means there is no reading yet: the scale stays, the arc and number do not. |
label | string | Required | What the gauge measures. Shown under the number and read by screen readers. |
min | number | Default 0 | The low end of the scale. |
max | number | Default 100 | The high end of the scale. A reading outside the scale pins the arc at the end; the number still shows the real reading. |
warnAt | number | – | From this reading up, the gauge is in its warning zone. |
alarmAt | number | – | From this reading up, the gauge is in its alarm zone. |
color | string | Default var(--foreground) | Any CSS colour for the arc while the reading is below both zones. Neutral by default, so colour appears only when a zone is entered. |
format | Intl.NumberFormatOptions | Default compact | How the reading and the two ends of the scale are written. |
locale | string | Default "en-US" | Locale for number formatting. |
zoneLabels | { warn: string; alarm: string } | Default { warn: "High", alarm: "Critical" } | The words shown and spoken in each zone. Change them to translate or to fit the measurement. |
sound | boolean | Default true | Play a two-note signal when the reading climbs into a zone, if the visitor has sound on. |
className | string | – | Sets the width. The default is 224 pixels; the height and the text follow. |
Motion and sound
Motion
- First draw: the arc sweeps from the low end to the reading in about 400 ms while the number appears at its reading.
- A new reading moves the arc from where it is. It is one path whose drawn length changes, so it cannot overshoot the scale.
- Entering a zone changes the arc colour at once and shows the zone in words.
- Reduced motion: the arc and the number appear at the reading.
Sound
- A rising two-note signal when the reading climbs into the warning or the alarm zone. Nothing plays for the first reading, or on the way down.
Sound is off until the visitor turns it on. Pass sound={false} to keep this component silent. How sound works
Accessibility
- Exposed as a meter with its minimum, maximum and current value. The spoken value includes the zone, for example “92%, Critical”.
- The zone is always written in words beside a dot. Colour is never the only signal.
- With no reading, the spoken value is “No reading”.
- The gauge is not a live region. If a reading entering the alarm zone matters, announce it in your own words.
Source
The source comes with Pro
TypeScript source · Copy-paste ready · MIT-compatible for client projects · Includes all dependencies
Files and dependencies
- Adds
components/ui/gauge.tsx- Packages
motion- Brings along
- Chart foundationsMotion tokensSound engineAnimated number
Changelog
- 1.0.0 · 2026-12-02First release.