---
title: "Meter"
description: "A bar that shows one measured value in a known range, such as used storage. It changes color when the value reaches a low or high level."
url: https://gelatinui.com/components/meter
markdown_url: https://gelatinui.com/components/meter.md
access: free
install: "npx shadcn@latest add @gelatin-ui/meter"
registry_item: https://gelatinui.com/r/meter.json
version: "2026-11-08"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Meter

> A bar that shows one measured value in a known range, such as used storage. It changes color when the value reaches a low or high level.

Page: https://gelatinui.com/components/meter

## When to use it

Best for: One measured value in a known range at rest, such as storage used, a quota, or a battery level.

- Use it for a value at rest in a known range.
- Use `low`, `high`, and `optimum` to turn on the warning and critical colors.
- Use `variant` `ticks`, `segments`, `steps`, or `dots` on `MeterTrack` for a row of cells.
- Use `thickness="thin"` in a table cell.

## When not to use it

- For a task that moves toward done, use a [Progress](https://gelatinui.com/components/progress.md).
- For a value that people set, use a [Slider](https://gelatinui.com/components/slider.md).
- For a password score, use a [Password Strength](https://gelatinui.com/components/password-strength.md).

## Notes for agents

- With neither `low` nor `high`, the root has no `data-level` and the meter stays one color.
- Say the level in text too, with `MeterValue`, the label, or `getAriaValueText` ("82 of 100 GB used, almost full").
- A `format` formats the raw value. `{ style: "percent" }` with `value={24}` prints "2,400%". Leave out `format`, or pass a fraction with `max={1}`.
- A bar needs a `MeterIndicator`. A segmented track draws its own cells and does not render children.
- A segment fills when the value covers at least half of it. 1% of 30 ticks fills none.
- `MeterIndicator` takes `variant="muted"` for a quiet fill with no level color.
- A new value takes its width at once, with no transition.

## Anatomy

```text
Meter
├─ MeterLabel (0..n)
├─ MeterValue (0..n)
├─ MeterTrack (0..n)
└─ MeterIndicator (0..n)
```

## API reference

### Meter

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `low` | `number` |  | The top of the low region, as on the native `<meter>`. Set it or `high` to get levels. |
| `high` | `number` |  | The bottom of the high region, as on the native `<meter>`. |
| `optimum` | `number` |  | The best value. Under `low`: low is good. Over `high`: high is good. Between: the middle. |
| `glow` | `boolean` |  | A soft halo in the fill color (`glow`, `@gelatin-ui/glow`). Default: `false`. |

Also takes every prop of Base UI `Meter.Root`: https://base-ui.com/react/components/meter

### MeterLabel

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |

### MeterValue

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |

Also takes every prop of Base UI `Meter.Value`: https://base-ui.com/react/components/meter

### MeterTrack

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `thickness` | `"thick" \| "thin"` | "thick" |  |
| `rounded` | `"default" \| "full"` |  |  |
| `size` | `"default" \| "lg" \| "sm" \| "xs"` |  |  |
| `className` | `string` |  |  |
| `variant` | `"bar" \| "dots" \| "segments" \| "steps" \| "ticks"` | "bar" | `bar` (default): one fill. The others draw a row of segments. |
| `segments` | `number` |  | The segment count of a segmented look. Default: ticks 30, segments 10, steps 5, dots 20. |

### MeterIndicator

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `variant` | `"default" \| "muted"` | "default" | `default`: the ink fill (and the level colors). `muted`: a quiet gray fill (`muted-foreground` at 50%) with no level color, for the bars of a comparison where only the one that leads takes the ink: the results of a Poll before its winner. The color is never the only signal: the value text says which one leads. |

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| Meter | `meter` |  |  |  |
| MeterLabel | `meter-label` |  |  |  |
| MeterValue | `meter-value` |  |  |  |
| MeterTrack | `meter-track` | `data-level` |  | `status-colors` |
| MeterIndicator | `meter-indicator` |  |  |  |

## Usage

A meter shows a value in a known range; for a task that moves, use a Progress. Set `low`, `high`, and `optimum` to color the levels.

```tsx title="storage-meter.tsx"
import { Meter, MeterIndicator, MeterLabel, MeterTrack, MeterValue } from "@/components/ui/meter";

export function StorageMeter() {
  return (
    <Meter value={64} locale="en-US">
      <MeterLabel>Storage</MeterLabel>
      <MeterValue />
      <MeterTrack>
        <MeterIndicator />
      </MeterTrack>
    </Meter>
  );
}
```

## Compose

Rules:

- Compose the parts (`compose-parts`): Build each item from its named parts as children, and pass your text and icons in as parts.
- Every state is designed (`every-state`): Give each view of data its loading, empty, and error states: a skeleton in the final layout, an `Empty` with an illustration and one next action, and an error that says what failed and how to retry.

## Add it

```bash
npx shadcn@latest add @gelatin-ui/meter
```

It adds 15 registry items: 11 files, 2745 lines, and the npm packages `@base-ui/react`, `clsx`, `motion`, `tailwind-merge`, `tailwind-variants`.

## For AI agents

- Every item, one file: https://gelatinui.com/llms.txt
- MCP server (`search_items`, `get_item`, `get_install_plan`): https://gelatinui.com/mcp

## Related

- [Progress](https://gelatinui.com/components/progress.md)
- [Circular Progress](https://gelatinui.com/components/circular-progress.md)
- [Password Strength](https://gelatinui.com/components/password-strength.md)
- [Spinner](https://gelatinui.com/components/spinner.md)

## Accessibility

It is a Base UI Meter with the `meter` role. `MeterLabel` names it; with no label, pass `aria-label`.

Say the level in text too, with `MeterValue`, the label, or `getAriaValueText`.

Pass `locale` on a server-rendered page, so the digits match after hydration.

## Motion

| Part | Motion |
| --- | --- |
| Value | none · the fill takes each new width at once |
