Xzero UI
Pro library

Gauge

Show a value against a known range.

$ pnpm dlx shadcn@4.23.0 add @xzero-ui/gauge
Live · keyboard ready

When to use

When not to use

Installation

Register both Xzero UI namespaces in your project's components.json:

{
  "registries": {
    "@xzero-ui": "https://mcp.xzero.co.uk/r/{name}.json",
    "@xzero-ui-pro": "https://mcp.xzero.co.uk/r/pro/{name}.json"
  }
}
npx shadcn@4.23.0 add @xzero-ui/gauge

Install xzero-foundation once, and import @/components/xzero/foundation.css in your app root. No Xzero token is used by this snapshot. For sample portraits, photos, fonts, or logos, download https://mcp.xzero.co.uk/install-assets.mjs and run node xzero-install-assets.mjs <receiving-project>.

Usage

import { Gauge } from "@/components/xzero/gauge/gauge";

export function DiskUsage() {
  return (
    <Gauge
      label="Disk usage"
      value={72}
      detail="360 of 500 GB"
      thresholds={[
        { from: 0, tone: "success", label: "Healthy" },
        { from: 70, tone: "warning", label: "Filling up" },
        { from: 90, tone: "danger", label: "Critical" },
      ]}
    />
  );
}

API reference

Gauge

A 270 degree ring meter with a percent readout and optional labelled threshold bands.

PropTypeDefaultDescription
value (required)number–Current value within min and max.
minnumber0Lower bound.
maxnumber100Upper bound.
label (required)string–What is measured.
detailstring–Secondary caption line.
tone"accent" | "success" | "warning" | "danger""accent"Ring color when no threshold applies.
thresholds{ from: number; tone: "accent" | "success" | "warning" | "danger"; label: string }[]–Bands by starting value. The highest band reached sets the tone and shows its label.

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

Also in charts

Guidance for AI tools

Gauge: Show a value against a known range. Follow the declared prop types and do not invent props. Keep keyboard access, reduced motion support, and both light and dark themes intact when adapting it.

Full library index: https://ui.xzero.co.uk/llms.txt

Browse all components