Skip to Content
✨ QuickCode UI keeps growing! More components, more features, and more ways to make your projects shine. Stay tuned & maybe… hire me or sponsor me 😉 
DocumentationGauge Chart

Gauge Chart

A visual indicator for displaying single-value metrics with configurable ranges and color segments.

Install Dependencies

npx
quickcode-ui add GaugeChart

Examples

Default

//0100
67of 100

Full Circle

//
$7,800of $10,000

Custom Segments

//0%100%
45%of 100%
//0 mph100 mph
82 mphof 100 mph
//0K500K
385Kof 500K

Props

PropTypeDefaultDescription
valuenumberThe current value to display on the gauge
minnumber0Minimum value of the gauge range
maxnumber100Maximum value of the gauge range
startAnglenumber-90Starting angle in degrees (0 is 3 o’clock, -90 is 12 o’clock)
endAnglenumber90Ending angle in degrees
segmentsArray<{threshold: number, color: string, label?: string}>[{ threshold: 0, color: "var(--destructive)" }, { threshold: 33, color: "var(--chart-2)" }, { threshold: 66, color: "var(--chart-3)" }]Array of color segments with threshold values (0-100 range)
showValuebooleantrueWhether to display the value text below the gauge
showLabelsbooleantrue (not applicable for full circle)Whether to display min/max labels
valueFormatter(value: number) => string(v) => String(v)Function to format the displayed value
needleColorstringvar(--foreground)Color of the gauge needle
trackColorstringvar(--muted)Color of the background track
sizenumber200Size of the gauge in pixels
classNamestringAdditional CSS classes
Last updated on