Meter
A linear bar of what is left: a plan window or a quota, low from 15%, red once spent.
import { Meter } from "@arcadia/ui"A linear bar of what is left, never of what is used: a full bar is room, an empty one is spent. value is the remaining share, 0 to 100. tone says how it reads: neutral, warning (a yellow fill) at 15% left or under, danger once the window is spent, when the whole track takes a red tint. Pair it with the plan formatters (fmtLeft, fmtReset, leftTone) so the number beside it reads the same on every surface.
Examples
rootStyle takes layout and these knobs. tone sets the fill and the track; set them yourself only for a meter whose tones mean something else.
| Knob | Takes | Default | Sets |
|---|---|---|---|
Ref<Space> | var(--space-1) | The bar's thickness. | |
Paint | var(--icon-2) | What is left (yellow when low). | |
Paint | var(--fill-3) | The full bar under the fill (a red tint once empty). |
With a label the bar is a meter with its value and range, and a valueText that says the whole fact: "52% left, resets October 11 at 16:37". Without a label it is decorative, beside text that already says it. Tone is colour only, so the words beside the bar carry low and spent too: a window under one percent reads as less than 1% left, a spent one as Limit reached.
Meter
valuerequired- number
- What is left, 0..100 (clamped): a plan window's remaining share, never the used one.
tone- "neutral" | "warning" | "danger"Default"neutral"
neutral;warning(a yellow fill) when low, at 15% left or under;danger(a red track) once spent. Default: neutral.size- "sm" | "md"Default"md"
md(4px, a plan window on its own row) orsm(2px, a dense row).label- string
- Accessible name ("Weekly"). With a label the bar is a
meter; without one it is decorative. valueText- string
- Spoken value: "52% left, resets October 11 at 16:37". Default: the rounded value with "left".
rootStyle- RootStyle<MeterKnobs>
- Typed StyleX override: layout and the
--meter-*knobs.