Skip to content
Thrum

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/gauge

This is a Pro component. The command works once your project has a licence key: set up Pro or see pricing.

Props

PropTypeDefaultDescription
valuenumber | nullRequiredThe reading. null means there is no reading yet: the scale stays, the arc and number do not.
labelstringRequiredWhat the gauge measures. Shown under the number and read by screen readers.
minnumberDefault 0The low end of the scale.
maxnumberDefault 100The high end of the scale. A reading outside the scale pins the arc at the end; the number still shows the real reading.
warnAtnumber–From this reading up, the gauge is in its warning zone.
alarmAtnumber–From this reading up, the gauge is in its alarm zone.
colorstringDefault 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.
formatIntl.NumberFormatOptionsDefault compactHow the reading and the two ends of the scale are written.
localestringDefault "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.
soundbooleanDefault truePlay a two-note signal when the reading climbs into a zone, if the visitor has sound on.
classNamestring–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

SourcePro

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. 1.0.0 · 2026-12-02First release.

Loading index…

Keyboard shortcuts

/Ctrl KSearch components, docs and actions
?Show this list
AAppearance studio
SSound on or off
MFull or reduced motion
TTheme: auto, light, dark
GSurface: solid or frosted
BBackdrop photograph (under glass)
CCorner radius: square to round
RReplay the demo, on a component page
DDraw new data, on a component page
←→HomeEndMove the cursor in a focused chart
EscClose a dialog, or leave a chart cursor