Components · Data Display
Gauge
BetaAdded v4.5.0
Progress toward a target on a 270° arc.
import { Gauge } from '@nexub/react';Playground
Props
<Gauge label="68 GB" color={2} title="Storage used" value={68} />Examples
Storage used
Tone and caption
States
Storage used: 68 of 100 (68%) defaultloadingStorage used: 68 of 100 (68%) tone="warning"Storage used: 68 of 100 (68%) tone="danger"Storage used: 68 of 100 (68%) tone="good"
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| valuerequired | number | — | Current value. |
| max | number | 100 | Target. |
| titlerequired | string | — | Accessible name. |
| label | React.ReactNode | — | Centre text; defaults to the percentage. |
| color | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 1 | Palette colour, 1–8. |
| tone | 'warning' | 'danger' | 'good' | — | 11.3: success, warning or error colour for the arc; wins over color. Pair it with a caption so colour is not the only signal. |
| caption | React.ReactNode | — | 11.3: a short line under the value, such as "41 of 50 GB" or "Over budget". Also read with the value. |
| emptyState | React.ReactNode | — | Shown when there is no data. Defaults to the "no data" message. |
| errorState | React.ReactNode | — | Shown in place of the data when a load failed, for example an ErrorState with a retry action. Wins over loading and empty. |
| loading | boolean | — | Shows a skeleton in place of the data and sets aria-busy. |
Accessibility
Screen reader
The drawing is hidden from assistive tech; a visually hidden table or caption carries every value.
On iOS & Android
Web only
Gauge has no @nexub/react-native twin. On phones, follow the platform pattern instead, or compose it from the native components listed on the React Native page.