Gauge Chart

A segmented notch gauge — a single value lit across a 270° arc of tapered notches, with a spring-wave entrance, a rolled center stat, and a loading state.

Installation

pnpm add @blakeui/pro-react
npm install @blakeui/pro-react
yarn add @blakeui/pro-react
bun add @blakeui/pro-react

Usage

GaugeChart is built on visx arc math and the motion library. It is a single component: pass value (measured against maxValue, default 100) and the gauge lights round(value / maxValue × notchCount) of its 40 tapered notches across a 270° sweep that opens at the bottom. The track notches map to the neutral --separator token; the lit notches ride --chart-1 (the single-series data color). The bowl shows a rolled stat — centerValue (defaulting to value) through the shared Odometer, over a muted centerLabel. There is no hover layer by design: a single-value gauge has nothing further to inspect.

import {GaugeChart} from "@blakeui/pro-react";

function App() {
  return (
    <GaugeChart
      centerLabel="ARR run rate"
      centerValue={428000}
      value={66}
      valuePrefix="$"
    />
  );
}

Motion

On mount the 40-notch track springs in as a center-origin wave (each notch staggered 15ms), and the lit value layer follows after a 300ms hand-off (20ms per notch). The center stat always rolls through the Odometer. All motion collapses to an instant render under prefers-reduced-motion, and the gauge exposes its value to assistive tech through a polite live region.

Loading state

Set status="loading" to show a stroke-only skeleton arc while data resolves; flip it to "ready" and the load→ready choreography plays — the pulse flows out along the arc, the caption exits, and the notch wave springs in.

API Reference

GaugeChart

The single chart component. Measures its container (a 21:16 box when responsive), computes the notch geometry, and renders the track wave, value layer, center stat, and loading chrome.

PropTypeDefaultDescription
valuenumberCurrent value. The lit notch count is round(value / maxValue × notchCount).
maxValuenumber100Value at which every notch is lit.
notchCountnumber40Number of notches around the sweep.
spacingnumber25Percentage of the sweep reserved for the gaps between notches.
notchRadiusnumber0Corner radius of each notch in px (0 = sharp trapezoids).
startAnglenumber135Sweep start angle in degrees (0° = east, clockwise).
endAnglenumber405Sweep end angle in degrees. The defaults draw a 270° sweep opening at the bottom.
trackOpacitynumber0.4Unlit-track notch opacity.
sizenumberFixed box width in px (height follows the 21:16 ratio). Omit for responsive sizing.
showCenterbooleantrueRender the rolled value + label in the bowl.
centerValuenumbervalueValue shown by the center Odometer (e.g. a dollar figure behind a percentage gauge).
centerLabelstring"Total"Center label under the value.
valuePrefixstringStatic text rendered before the center value (e.g. "$").
status"loading" | "ready""ready"While loading, shows the skeleton arc. Flipping to ready plays the entrance.
loadingLabelstring""Centered caption shown while loading. Empty string hides it.

Also supports all native div HTML attributes.

On this page