Skip to content
  • System
  • Light
  • Dark
  • High contrast

Gauge

Different sizes, colours, and format functions.

72Assessed
3.5Score
import { Gauge } from '@eekodigital/raster';

<Gauge value={72} max={86} label="Assessed" />
<Gauge value={3.5} max={4} label="Score" format={(v) => v.toFixed(1)} color="var(--demo-good)" />
<Gauge value={45} max={100} label="Complete" format={(v) => `${v}%`} size={80} thickness={8} />
  • role="meter" with aria-valuemin, aria-valuemax, aria-valuenow and aria-valuetext from format.
  • Named by the visible label through aria-labelledby, so what you see is what is announced.
  • The fill transition stops under prefers-reduced-motion.

See the Accessibility guide for the shared structure, the labels prop and screen-reader testing.

PropTypeDefaultDescription
valuenumber—Required.
minnumber0Start of the range.
maxnumber—Required. End of the range.
labelstring—Required. Visible label and accessible name.
format(value: number) => stringIntl.NumberFormat(“en”)

Formats the displayed value and aria-valuetext.

sizenumber—Fixed diameter in px. Omit to fill the container’s width (square).
thicknessnumber10Ring thickness in px.
colorstringseries 1Fill colour.
trackColorstringgrid colourTrack colour.
exportRefRef<ChartExportHandle>—SVG/PNG export.
classNamestring—