Skip to content
Thrum

Ring meter

A circular meter for one reading against a maximum: disk used, quota spent, a score out of 100. Use it where a compact, glanceable figure is wanted. When the limit and the thresholds matter more than the shape, use the usage meter.

Install

npx shadcn@latest add @thrum-pro/ring-meter

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

Props

PropTypeDefaultDescription
valuenumberRequiredThe reading. Below 0 or above max it is drawn as an empty or a full ring, and the number still shows the real value.
maxnumberDefault 100The value of a full ring.
labelstringRequiredWhat the ring measures. It is the name screen readers hear.
formatIntl.NumberFormatOptionsDefault compactHow the number in the centre and the spoken value are written.
localestringDefault "en-US"Locale for number formatting.
status"normal" | "ok" | "warn" | "alarm"Default "normal"Colours the arc. normal is the text colour, ok the theme's success colour, warn its warning colour and alarm its destructive colour.
statusLabelstring–The state as a word, under the number and in the spoken value. The default follows status: OK, warning or critical. Pass your own to translate it.
showLabelbooleanDefault falseShow the label as a compact caption under the centre reading when no status word is active.
thicknessnumberDefault 10Width of the ring in pixels. It is limited to half the size of the ring.
soundbooleanDefault truePlay a soft tone when the number lands, if the visitor has sound on.
classNamestring–Sets the size. The default is 128 by 128 pixels. The number scales with the ring.

Motion and sound

Motion

  • First draw: when the ring scrolls into view, the arc sweeps clockwise from 12 o'clock in about 400 ms and the number rolls up from zero with it.
  • A new value moves the arc and the number from where they are, with no overshoot. A change during a sweep continues from the current position.
  • The arc fades out in 150 ms when the value reaches zero, so no dot is left at 12 o'clock.
  • Reduced motion: the arc and the number appear at their value and change instantly.

Sound

  • A short tone when the number lands. The arc is silent.

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 named by the label, with a minimum of 0, the maximum, and a spoken value such as “72% of 100%”.
  • A status other than normal is a word as well as a colour: OK, warning or critical. It is shown under the number and added to the spoken value.
  • The number is the real value even when the ring is clamped: 128% draws a full ring and reads 128%.
  • It is not focusable: there is nothing to operate.

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/ring-meter.tsx
Packages
motion
Brings along
Chart foundationsMotion tokensAnimated 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