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

LinearGauge

Assessed72 / 86
Complete45%
Criteria86 / 86
import { LinearGauge } from '@eekodigital/raster';

<LinearGauge value={72} max={86} title="Assessed" />
<LinearGauge value={45} max={100} title="Complete" color="var(--demo-warn)" formatLabel={(v) => `${v}%`} />
<LinearGauge value={86} max={86} title="Criteria" color="var(--demo-good)" />
  • role="meter" with aria-valuemin, aria-valuemax, aria-valuenow and aria-valuetext from format.
  • Named by the visible title through aria-labelledby.
  • Fills its container’s width; the grow animation stops under prefers-reduced-motion.

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

PropTypeDescription
valuenumberRequired.
minnumber

Default: 0

Start of the range.
maxnumberRequired. End of the range.
titlestringRequired. Visible title and accessible name.
labelsChartLabelOverrides

locale for the default number format, as on the other charts.

formatValue(value: number) => string

Default: Intl.NumberFormat

Formats the value and aria-valuetext.

formatLabel(value, max) => string

Visible value text (default {value} / {max}).

heightnumber

Default: 8

Track height in px.
colorstring

Default: series 1

Fill colour.
classNamestring