# Gauge

Show a bounded measurement with an exact reading, supplied thresholds, and native meter semantics.

Access: pro. Category: Data. Kind: composite.

## When to use

- Use it when a page needs show a bounded measurement with an exact reading, supplied thresholds, and native meter semantics.
- Choose it when the data structure, labels, and state are supplied by the application and must remain consumer controlled.

## Alternatives

- Choose analytics-card instead when explore revenue, compare periods and inspect chart values is the actual interface need, rather than gauge.

## Setup for agents

Use React 19 and TypeScript. Initialize shadcn for your framework, then merge this exact entry into components.json:

```json
{
  "registries": {
    "@tidal-pro": {
      "url": "https://tidalui.com/r/pro/{name}.json",
      "headers": {
        "Authorization": "Bearer ${TIDALUI_TOKEN}"
      }
    }
  }
}
```

The namespace must be named **@tidal-pro** because transitive Pro dependencies use that namespace. Obtain an agent key from your active Pro account at https://tidalui.com/account. Keep TIDALUI_TOKEN in your local environment, never in components.json, client code, Git or logs.

```sh
export TIDALUI_TOKEN='your-private-agent-key'
npx shadcn@latest add @tidal-pro/waitlist-form
npx shadcn@latest add https://tidalui.com/r/tidal-button.json
```

Free command: `npx shadcn@latest add https://tidalui.com/r/<name>.json`.
Pro command: `npx shadcn@latest add @tidal-pro/<name>`.

Import the base stylesheet and every stylesheet listed on the installed item's metadata. For example:

```tsx
import "./components/ui/tidal.css";
import "./components/ui/hero-section.css";
// Place installed components inside this wrapper:
<div className="tidal-scope" data-theme="dark">...</div>
```

Omit data-theme for the default light theme. Put the attribute on the same tidal-scope element for dark mode. Every component installs the shared free tidal-base dependency. After upgrading, run `npx shadcn@latest add https://tidalui.com/r/tidal-base.json --overwrite` to receive current tokens. Review local modifications before overwriting.

Vite: Use React + TypeScript. Map @/* to ./src/* in paths and Vite resolve.alias. Import tidal.css and each component stylesheet in your application entry.

Next.js 15 App Router: Next.js App Router: import tidal.css and component CSS in app/layout.tsx. Interactive examples belong in a client component with "use client". Map @/* to ./* or ./src/* to match your project.

TypeScript 6: use paths without baseUrl:

```json
{
  "compilerOptions": {
    "paths": {
      "@/*": [
        "./src/*"
      ]
    }
  }
}
```

Pro registry requests are server/CLI-only. Use the same-origin account interface in a browser; cross-origin Authorization preflights are intentionally unsupported.


## Install Gauge

```sh
npx shadcn@latest add @tidal-pro/gauge
```

Stylesheets: `components/ui/tidal.css`, `components/ui/gauge.css`.

## Minimal example

```tsx
import"./components/ui/tidal.css";
import"./components/ui/gauge.css";
import{TidalGauge}from"./components/ui/gauge";
export default()=><div className="tidal-scope"><TidalGauge label={"Demo"} value={1}/></div>;
```

## Structured props

- `TidalGauge.label: string`: Required label value accepted by this exported component.
- `TidalGauge.value: number | null`: Required value value accepted by this exported component.
- `TidalGauge.description?: ReactNode`: Optional description value accepted by this exported component.
- `TidalGauge.formatValue?: ((value: number) => string) | undefined` (default String): Optional format value value accepted by this exported component.
- `TidalGauge.high?: number | undefined`: Optional high value accepted by this exported component.
- `TidalGauge.labels?: Partial<{ unavailable: string; invalid: string; minimum: string; maximum: string; low: string; high: string; optimum: string; }> | undefined` (default {}): Optional labels value accepted by this exported component.
- `TidalGauge.low?: number | undefined`: Optional low value accepted by this exported component.
- `TidalGauge.max?: number | undefined` (default 100): Optional max value accepted by this exported component.
- `TidalGauge.min?: number | undefined` (default 0): Optional min value accepted by this exported component.
- `TidalGauge.optimum?: number | undefined`: Optional optimum value accepted by this exported component.
- `TidalGauge.unit?: ReactNode`: Optional unit value accepted by this exported component.

## Complete usage example

[Source](https://tidalui.com/examples/gauge.tsx) | [Manifest](https://tidalui.com/examples/gauge.json). Install the listed additional dependencies. Consumer fixture: TypeScript pass; Vite pass. This fixture check is distinct from the actual shadcn install receipt.

```tsx
import "./components/ui/tidal.css";

import { useState } from "react";

import { TidalGauge } from "./components/ui/gauge";

import "./components/ui/gauge.css";



export function GaugeDemo() {
  const [value, setValue] = useState(64);
  return (
    <div style={{ width: "100%", maxWidth: 380, display: "grid", gap: 18 }}>
      <TidalGauge
        label="Capacity used"
        value={value}
        min={0}
        max={100}
        low={25}
        high={80}
        unit="%"
        description="Sample utilization against a supplied capacity limit."
      />
      <label style={{ display: "grid", gap: 8, fontSize: 12 }}>
        Sample capacity
        <input
          aria-label="Sample capacity"
          type="range"
          min={0}
          max={100}
          value={value}
          onChange={(e) => setValue(Number(e.target.value))}
          style={{ width: "100%", minHeight: 44, accentColor: "var(--t-ink)" }}
        />
      </label>
    </div>
  );
}

export default function AgentExample() {
  return (
    <div className="tidal-scope" data-theme="light" dir="ltr">
      <GaugeDemo />
    </div>
  );
}

```

## Gotchas

- The host application owns data, validation, persistence, navigation, and service side effects described by this API.

## Theme and accessibility

{"tokens":["--t-accent","--t-border","--t-border-strong","--t-canvas","--t-danger","--t-display","--t-ease-out","--t-ease-spring","--t-faint","--t-font","--t-ink","--t-line","--t-muted","--t-primary","--t-primary-contrast","--t-radius-card","--t-radius-control","--t-radius-overlay","--t-radius-panel","--t-ring","--t-shadow-lg","--t-shadow-soft","--t-soft","--t-subtle","--t-surface","--t-wash"],"darkMode":true}

{"aria":"The component wires labels and relationships from consumer-provided visible text or ARIA props; preserve those labels in production.","notes":"Verify focus visibility, text alternatives, contrast, and reduced motion in the final composition."}

Consumer-owned value is a finite number within a finite increasing min/max range, or null for no reading. low/high/optimum are optional finite in-range values, with low<=high. Invalid configurations show an explicit error instead of silently clamping. The decorative semicircle and threshold markers accompany exact text and a native meter; null values omit the needle and meter. Domains normalize before subtraction to support extreme finite ranges. label is required; unit/description ReactNode content, exact formatValue, translated labels, figure attributes and root ref are supported. Visual numeric progression remains left-to-right in RTL. No measurement, polling, inference, threshold classification, animation loop or external effect occurs.
