Gauge

A speedometer gauge — a value arc over a min–max sweep with threshold zones, ticks, and a needle.

Category: chart · WCAG 2.1-AA · chart, gauge, speedometer, kpi, data-viz

Props

PropTypeDefaultDescription
valuenumberThe value the needle points to.
minnumber0Minimum allowed value.
maxnumber100Maximum allowed value.
thresholds{ upTo: number; color: string }[]Coloured zones from min upward; the last should reach max.
unitstringSuffix after the centre value.
sweepnumber270Total sweep angle in degrees (270 = a speedometer arc).
ticksnumber5Major tick count.
titlestringChart title (also aria-label).
descriptionstringSupporting description text.
widthnumberFixed SVG width in px. ⚠ **Omit for a responsive chart** — the chart fills and tracks its container via a ResizeObserver; there is no correct pixel number in a responsive grid. A fixed width is clamped to the container (max-inline-size: 100%) so it can never overflow its card, but it also stops the chart growing. `useChartSize` is NOT needed for this — charts call it internally.
heightnumber240SVG height in px. Unlike `width`, height does NOT track the container — this is the knob you set to change the chart's aspect.
classNamestringAdditional CSS class names merged onto the root element.
plainbooleanfalseMarks only — no ticks/labels. For micro/inline charts.

Design tokens

When to use

When not to use

Examples

Speedometer with zones

import { Gauge } from '@cascivo/charts'

<Gauge
  title="CPU load"
  value={72}
  unit="%"
  thresholds={[
    { upTo: 50, color: 'var(--cascivo-chart-2)' },
    { upTo: 80, color: 'var(--cascivo-chart-3)' },
    { upTo: 100, color: 'var(--cascivo-chart-4)' },
  ]}
/>

Related components

← Back to docs