Gauge
One value against its range on a 240° arc: zones that change its tone, a target tick, the value written in the middle.
- Domaine
- Affichage de données
- Niveau de support
- 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
Installation
Installer
npm install @krizaka/chartsImporter
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.
| Prop | Type | Défaut | Description |
|---|---|---|---|
valuerequis | number | — | The value. |
actionsMenu | boolean | — | The ⋯ actions menu of the kit. false: the former “Show data” and export buttons, drawn in line. Default true. |
brand | BrandId | — | 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). |
caption | string | — | The words under the value (“of 50 000 credits”). |
className | string | — | A class on the figure (layout: margins, grid placement). |
description | ReactNode | — | A sentence under the title: the period, the unit, the source. |
empty | ReactNode | — | What to show when there is nothing to draw (default: the empty label). An EmptyState of
@krizaka /ui fits. |
error | ReactNode | — | The data could not be loaded: true says the default words, a node says yours (a retry button…). |
format | ValueFormat | — | How the value and the range are written. |
height | number | — | The height of the plot in pixels. Default 280 (a sparkline: 32). |
hideTitle | boolean | — | Visually hide the title (it stays the chart's accessible name): a card that already has its heading. |
id | string | — | The id of the figure. |
insight | ReactNode | — | One line that says what the chart shows, between the title and the chart: “100 jobs · +100 % vs last week”. |
labels | ChartLabelsInput | — | The words, translated: the buttons, the states, the written summary. |
live | boolean | — | Streaming data (a job queue, an auction): no entrance on updates, no announcement of every new point. |
loading | boolean | — | The data is on its way: a skeleton of the chart, announced once. |
locale | Locale | — | The locale of every figure and date ("fr-FR"). Default "en-US". |
max | number | — | The end of the range. Default 100. |
min | number | — | The start of the range. Default 0. |
style | CSSProperties | — | 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"). |
summaryText | string | — | Your own summary instead of the generated one (still read first by screen readers). |
target | Threshold | — | A tick on the arc: the objective. |
title | string | — | 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. |
tone | Tone | — | The tone of the value without zones. Default "accent". |
zones | readonly 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.
Composants liés
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