crucıble

Gauge

A radial sweep gauge whose arc springs to its value with a calibrated overshoot-and-settle while the center count ticks up in lockstep. Continuous, segmented-tick, and half-speedometer variants; threshold crossings shift the hue over 300ms instead of snapping.

motionfree

Installation

CLI

npx shadcn@latest add @crucible/gauge

Manual — install dependencies, then copy the source

npm install motion

Props

PropTypeDefaultDescription
valuenumberCurrent value. Clamped to [0, max] for the sweep and aria semantics.
maxnumber100Value at which the gauge reads full.
variant"arc" | "segments" | "half""arc"Arc style: continuous ring, discrete igniting ticks, or 180° speedometer.
sizenumber200Outer diameter of the gauge in px (half variant is size wide, half as tall).
thicknessnumber10Stroke thickness of the arc in px.
gapAnglenumber80Opening at the bottom of the ring in degrees (arc/segments variants; half is fixed at 180°).
segmentCountnumber24Number of ticks in the segments variant.
stiffnessnumber80Spring stiffness — higher sweeps faster.
dampingnumber14Spring damping — lower overshoots further past the mark before settling.
showValuebooleantrueRender the auto count-up value in the center (ignored when children is set).
formatValue(value: number) => stringv => String(Math.round(v))Formats the center count-up (and aria-valuetext).
childrenReact.ReactNodeCustom center content — replaces the auto count-up entirely.
colorsGaugeColorsTrack / value-arc / center-text colors.
thresholdsGaugeThreshold[]Ascending color stops; the arc's hue shifts over ~300ms as the sweep crosses each.
ticksbooleantrueDraw the hairline tick ring inside the arc (arc/half variants).
trigger"in-view" | "mount""in-view"When the first sweep runs: on scroll into view, or immediately on mount.
pausedbooleanfalseFreezes the needle mid-flight; unpausing resumes toward the target.
labelstring"Gauge"Accessible name for the meter.
Also accepts all props of React.ComponentPropsWithoutRef<"div">they pass through to the underlying element.

Honors prefers-reduced-motion with a designed static fallback, and passes className through.