Skip to content
nexubDesign System
v11.9.0

Components · Data Display

Gauge

BetaAdded v4.5.0

Progress toward a target on a 270° arc.

import { Gauge } from '@nexub/react';
View as Markdown

Playground

Props

Storage used: 68 of 100 (68%)
TSX
<Gauge label="68 GB" color={2} title="Storage used" value={68} />

Examples

Storage used

Storage used: 68 of 100 (68%)

Tone and caption

Uptime: 99 of 100 (99%), On target
Storage used: 82 of 100 (82%), 41 of 50 GB
Budget spent: 104 of 100 (100%), Over budget

States

  • Storage used: 68 of 100 (68%)
    default
  • loading
  • Storage used: 68 of 100 (68%)
    tone="warning"
  • Storage used: 68 of 100 (68%)
    tone="danger"
  • Storage used: 68 of 100 (68%)
    tone="good"

Props

Props
PropTypeDefaultDescription
valuerequirednumber—Current value.
maxnumber100Target.
titlerequiredstring—Accessible name.
labelReact.ReactNode—Centre text; defaults to the percentage.
color1 | 2 | 3 | 4 | 5 | 6 | 7 | 81Palette 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.
captionReact.ReactNode—11.3: a short line under the value, such as "41 of 50 GB" or "Over budget". Also read with the value.
emptyStateReact.ReactNode—Shown when there is no data. Defaults to the "no data" message.
errorStateReact.ReactNode—Shown in place of the data when a load failed, for example an ErrorState with a retry action. Wins over loading and empty.
loadingboolean—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