Components
Meter
A measure against a limit, like spend against a budget: warm near it, red past it.
Import
import { Meter } from '@rinzai/zen';Examples
Milestones
A savings goal with milestones at each quarter: the ones passed are notched into the fill.
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.
| Prop | Type | Default |
|---|---|---|
valueRequired | number | — |
className | string | — |
detailTop right, e.g. "₹8,200 / ₹10,000". | ReactNode | — |
hintBelow the bar, e.g. "₹1,800 left". | ReactNode | — |
label | ReactNode | — |
marksMilestones along the bar, in the same units as value: e.g. [2500, 5000, 7500] of 10000. | number[] | — |
maxThe limit (default 100). Values past it fill the bar and turn it red. | number | 100 |
tone
| "auto" | "default" | "negative" | "warning" | auto |
valueTextWhat screen readers say for the value, e.g. "₹8,200 of ₹10,000, ₹1,800 left". | string | — |
warnAtFraction of max where | number | 0.85 |