# Meter

Show quotas, scores and other values against a known range.

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

## When to use

- Use it when a page needs show quotas, scores and other values against a known range.
- Choose it when the data structure, labels, and state are supplied by the application and must remain consumer controlled.

## Alternatives

- Choose data-table instead when sortable column controls, native row selection and a scrollable table is the actual interface need, rather than meter.

## 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 Meter

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

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

## Minimal example

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

## Structured props

- `TidalMeter.label: ReactNode`: Required label value accepted by this exported component.
- `TidalMeter.value: number`: Required value value accepted by this exported component.
- `TidalMeter.valueText: ReactNode`: Required value text value accepted by this exported component.
- `TidalMeter.description?: ReactNode`: Optional description value accepted by this exported component.
- `TidalMeter.high?: number | undefined`: Optional high value accepted by this exported component.
- `TidalMeter.low?: number | undefined`: Optional low value accepted by this exported component.
- `TidalMeter.max?: number | undefined` (default 100): Optional max value accepted by this exported component.
- `TidalMeter.maxLabel?: ReactNode`: Optional max label value accepted by this exported component.
- `TidalMeter.min?: number | undefined` (default 0): Optional min value accepted by this exported component.
- `TidalMeter.minLabel?: ReactNode`: Optional min label value accepted by this exported component.
- `TidalMeter.optimum?: number | undefined`: Optional optimum value accepted by this exported component.
- `TidalMeter.rootClassName?: string | undefined` (default ""): Optional root class name value accepted by this exported component.
- `TidalMeter.rootProps?: Omit<HTMLAttributes<HTMLDivElement>, "children"> | undefined`: Optional root props value accepted by this exported component.
- `TidalMeter.showScale?: boolean | undefined` (default true): Optional show scale value accepted by this exported component.

## Complete usage example

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

```tsx
"use client";

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

import { useId, useState } from "react";

import { TidalMeter } from "./components/ui/meter";

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



const tidalExampleStyles = ".tidal-scope .meter-demo {\n  container: meter-demo / inline-size;\n  display: grid;\n  width: min(100%, 560px);\n  min-width: 0;\n  gap: 24px;\n  color: var(--t-ink);\n}\n\n.tidal-scope .meter-demo-controls {\n  display: grid;\n  grid-template-columns: minmax(0, 1fr) auto;\n  gap: 8px 14px;\n  align-items: center;\n  min-width: 0;\n  padding-top: 18px;\n  border-top: 1px solid var(--t-border);\n}\n\n.tidal-scope .meter-demo-controls > label {\n  min-width: 0;\n  font-size: 12px;\n  font-weight: 620;\n  line-height: 1.4;\n  overflow-wrap: anywhere;\n}\n\n.tidal-scope .meter-demo-controls > input {\n  grid-column: 1;\n  width: 100%;\n  min-width: 0;\n  min-height: 44px;\n  margin: 0;\n  accent-color: var(--t-accent);\n  cursor: pointer;\n}\n\n.tidal-scope .meter-demo-controls > input:focus-visible,\n.tidal-scope .meter-demo-controls > button:focus-visible {\n  outline: 2px solid var(--t-accent);\n  outline-offset: 3px;\n}\n\n.tidal-scope .meter-demo-controls > button {\n  grid-column: 2;\n  grid-row: 1 / span 2;\n  min-height: 44px;\n  padding: 9px 14px;\n  border: 1px solid var(--t-border);\n  border-radius: var(--t-radius-control);\n  background: var(--t-surface);\n  color: var(--t-ink);\n  font: inherit;\n  font-size: 12px;\n  font-weight: 640;\n  cursor: pointer;\n  transition:\n    border-color 140ms,\n    color 140ms,\n    background-color 140ms,\n    transform 140ms var(--t-ease-out);\n}\n\n.tidal-scope .meter-demo-controls > button:hover {\n  border-color: var(--t-ink);\n  background: var(--t-ink);\n  color: var(--t-surface);\n}\n\n.tidal-scope .meter-demo-controls > button:active {\n  transform: scale(0.98);\n}\n\n@container meter-demo (max-width: 360px) {\n  .tidal-scope .meter-demo-controls {\n    grid-template-columns: minmax(0, 1fr);\n  }\n\n  .tidal-scope .meter-demo-controls > button {\n    grid-column: 1;\n    grid-row: auto;\n    width: 100%;\n  }\n}\n\n@media (prefers-reduced-motion: reduce) {\n  .tidal-scope .meter-demo-controls > button {\n    transition: none;\n  }\n\n  .tidal-scope .meter-demo-controls > button:active {\n    transform: none;\n  }\n}";

export function MeterDemo() {
  const generatedId = useId().replace(/:/g, "");
  const [used, setUsed] = useState(64);

  return (
    <section className="meter-demo" aria-label="Meter preview">
      <TidalMeter
        label="Project storage"
        value={used}
        valueText={`${used} GB of 100 GB`}
        min={0}
        max={100}
        low={60}
        high={85}
        optimum={0}
        minLabel="0 GB"
        maxLabel="100 GB"
        description="Sample storage usage."
      />

      <div className="meter-demo-controls">
        <label htmlFor={`${generatedId}-usage`}>Used storage</label>
        <input
          id={`${generatedId}-usage`}
          type="range"
          min="0"
          max="100"
          step="1"
          value={used}
          onChange={(event) => setUsed(event.currentTarget.valueAsNumber)}
        />
        <button type="button" onClick={() => setUsed(64)}>
          Reset sample
        </button>
      </div>
    </section>
  );
}

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

```

## Gotchas

- Supply truthful data and labels; the component does not fetch, aggregate, or persist records.

## 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."}

Required label, numeric value, and visible exact valueText. Optional min(default0), max(default100), low, high, optimum, description, minLabel/maxLabel, showScale(defaulttrue), rootClassName/rootProps, native meter attributes/className/style and forwarded ref. Nonfinite min falls back0. A nonfinite max or any max that does not exceed min resets the complete range to0–100 so even extreme finite inputs remain valid. Nonfinite value falls back min and value clamps into range. Supplied thresholds clamp into range, and inverted finite low/high are sorted so the native meter remains valid. Nonfinite thresholds use their documented boundary fallback. valueText and description are linked through aria-describedby; numeric ReactNode content is preserved. Boundary labels are visual/decorative because native min/max remain the semantic source. This is a read-only measurement, not task progress and not a form input. Consumers own units, exact display text, thresholds, requests, storage and updates.
