Krizaka UI
Krizaka UI

Gauge

One value against its range on a 240° arc: zones that change its tone, a target tick, the value written in the middle.

Web · ✓Mobile · ✓Bureau · ✓BêtaGraphiques
Niveau de support
Bêta
Taille
Non mesurée
Qui l'utilise
Aucun produit en production ne l'importe encore
import { Gauge } from "@krizaka/charts/gauge";

Web et mobile — le même composant pour React et React Native. Bêta : son API peut encore changer à une version mineure.

Pourquoi il est là. Its only users were products that left the organisation (2026-10-29): kept until the next major's audit decides.

Quand l’utiliser

  • A quota: credits used of a plan, with a warning zone before the limit.
  • Progress towards a goal with a target: a challenge's escrow against its objective.
  • A load or a score that has a known range.

Quand ne pas l’utiliser

  • Several values side by side (a gauge per item takes room and compares badly).À la place : Bar chart
  • A value without a meaningful range.À la place : Sparkline

Installation

Installer

npm install @krizaka/charts

Importer

import { Gauge } from "@krizaka/charts/gauge";

Exemples

Quota

Credits used of a plan: green, then warning past 80 %, danger past the plan.

Goal

A challenge's escrowed amount against its objective, a target tick on the arc.

Props

One figure against its range — credits used of a plan, a challenge's progress, a load.

PropTypeDéfautDescription
valuerequisnumber—The value.
actionsMenuboolean—The ⋯ actions menu of the kit. false: the former “Show data” and export buttons, drawn in line. Default true.
brandBrandId—The brand whose palette the charts use. Without it, a chart follows a .brand-<id> ancestor, else Krizaka. Set it when the app loads a brand stylesheet on :root (@krizaka/tokens/brands/sovkora.css).
captionstring—The words under the value (“of 50 000 credits”).
classNamestring—A class on the figure (layout: margins, grid placement).
descriptionReactNode—A sentence under the title: the period, the unit, the source.
emptyReactNode—What to show when there is nothing to draw (default: the empty label). An EmptyState of @krizaka /ui fits.
errorReactNode—The data could not be loaded: true says the default words, a node says yours (a retry button…).
formatValueFormat—How the value and the range are written.
heightnumber—The height of the plot in pixels. Default 280 (a sparkline: 32).
hideTitleboolean—Visually hide the title (it stays the chart's accessible name): a card that already has its heading.
idstring—The id of the figure.
insightReactNode—One line that says what the chart shows, between the title and the chart: “100 jobs · +100 % vs last week”.
labelsChartLabelsInput—The words, translated: the buttons, the states, the written summary.
liveboolean—Streaming data (a job queue, an auction): no entrance on updates, no announcement of every new point.
loadingboolean—The data is on its way: a skeleton of the chart, announced once.
localeLocale—The locale of every figure and date ("fr-FR"). Default "en-US".
maxnumber—The end of the range. Default 100.
minnumber—The start of the range. Default 0.
styleCSSProperties—Inline style on the figure (layout only: colours come from the tokens).
summary"hidden" | "visible"—The written summary: read by screen readers only ("hidden", default), or shown under the chart ("visible").
summaryTextstring—Your own summary instead of the generated one (still read first by screen readers).
targetThreshold—A tick on the arc: the objective.
titlestring—What the chart shows, in a few words: its accessible name, and its heading unless hideTitle. Inside a ChartCard, the card's title is the default.
toneTone—The tone of the value without zones. Default "accent".
zonesreadonly GaugeZone[]—Coloured zones along the arc: the value takes the tone of the zone it is in.

Accessibilité

  • The gauge is a meter: its name is the title, its value, range and text (value and caption) are exposed.
  • The zone's tone is never the only signal: its label is in the summary.
  • The arc fills once, when the gauge comes on screen, and never under reduced motion.

Bonnes pratiques

  • Say the range in caption (“of 50,000 credits”): the arc alone is not a number.
  • Give zones their meaning in label (“Over quota”): it is read in the summary.
  • Use one gauge per screen at most; a row of figures reads better as stats.

Générée depuis le code de @krizaka/ui 5.3.4 : son meta.ts, ses exemples et ses types.Modifier cette documentation sur GitHub

Sur cette page