Components

Meter

A measure against a limit, like spend against a budget: warm near it, red past it.

Groceries₹6,200 / ₹10,000
₹3,800 left
Dining out₹2,700 / ₹3,000
₹300 left
Transport₹4,100 / ₹3,500
₹600 over

Import

import { Meter } from '@rinzai/zen';

API reference

<Meter>

A measure against a limit, e.g. spend against a budget: a bar with a label, a figure and a note. Over the limit it turns red; near it, warm. Announced as a meter, with `valueText` read out instead of the bare number.

PropTypeDefault
valueRequired
number—
className
string—
detail

Top right, e.g. "₹8,200 / ₹10,000".

ReactNode—
hint

Below the bar, e.g. "₹1,800 left".

ReactNode—
label
ReactNode—
max

The limit (default 100). Values past it fill the bar and turn it red.

number100
tone

`auto` picks warning past `warnAt` of max and danger past max.

"auto" | "danger" | "default" | "warning"auto
valueText

What screen readers say for the value, e.g. "₹8,200 of ₹10,000, ₹1,800 left".

string—
warnAt

Fraction of max where `auto` turns to warning (default 0.85).

number0.85