Meter row
A limit as one line and its bar: what it measures, when it comes back and what is left.
import { MeterRow, MeterList, MeterListGroup } from "@arcadia/ui"TSX
Anatomy
- Line
- One style, Body, on one line: the name and its scope at the start, the circumstance against the figure at the end.
- Name
- What it measures, in
--text-1, Body bold. A mark before it is one run with the word, Body bold's icon, centred on its capitals,--space-1-5before it. It takes its room first: where it cannot share its line with the figure it takes a line of its own, and it never fades. - Scope
- Whose it is, where one thing has its own window: right after the name in
--text-3,--space-1-5apart. - Circumstance
- When it comes back, or how old the reading is: in
--text-3, pushed against the figure, at least--space-3from both. The first to give way. - Figure
- What is left, in
--text-1, tabular, in one end column as wide as the widest figure of the list. It takes the warning or danger ink with its tone, and only with its word. Never cut. - Bar
- A
Meteratmd,--space-1under the line, from the name's start to the figure's end: one width in every row. AMeterGroupin its place is a bar in parts. - Head
- A group's mark and name in
--text-2, a detail after it in--text-3, at most one control at its end,--space-2over its first row. - Rhythm
- Rows
--space-3apart from bar to line, three times a line's gap to its own bar; groups--space-6apart. No divider and no box between rows.
States
A bar in parts
A mark beside a name
A row that opens
An action at its end
Pointing at a part
Narrow
600px: all of it on one line
340px: the circumstance fades at its end; a name that cannot share its line with the figure takes one of its own
160px: a name on a line of its own wraps rather than fade
MeterRow
namerequired- string
- "Weekly": with
scope, the bar's accessible name. scope- string
- Whose window it is, where one thing has its own ("Fable").
detail- string
- The circumstance ("Resets in 3h"): the first to give way.
figure- string
- What is left, in words ("64% left"): never cut.
action- ReactNode
- A button or link in the figure's place. As a row's
faceit has none: the row's ownactionstands there. value- number
- What is left, 0..100.
segments- readonly MeterSegment[]
- A bar in parts instead of one
Meter. active- string | null
- The segment with the pointer (
MeterGroup's): it keeps its ink and the others go quiet. onActiveChange- (id: string | null) => void
- The pointer came to a segment, or left the bar (
null). valueText- string
- Default: the figure, then the detail.
rootStyle- RootStyle
- A component's typed override prop:
Layoutand its documented knobs, each the references it takes or another kit knob of its kind; anything else is a type error at the call site (STYLEX.md). held- number
- What comes back with it, 0..100: a faint second fill, drawn on a spent track too.
tone- "neutral" | "warning" | "danger"Default "neutral"
warning(yellow fill) at 15% left or under;danger(a red track) once spent.state- "level" | "off" | "unknown" | "pending" | "busy" | "none"Default "level"
- What the bar says when it is not a level.
emphasis- "strong" | "normal" | "quiet"Default "normal"
- The fill's rank among neighbouring meters.
stale- boolean
- The number is old (the last read failed): the bar steps back.
label- string
- Its accessible name.
rootStyle- RootStyle
- A component's typed override prop:
Layoutand its documented knobs, each the references it takes or another kit knob of its kind; anything else is a type error at the call site (STYLEX.md).
namerequired- string
- "OpenAI": with
detail, the group's accessible name. mark- IconName | ReactNode
detail- string
- After the name ("ChatGPT Plus").
action- ReactNode
- At most one control, at the end.
rootStyle- RootStyle
- A component's typed override prop:
Layoutand its documented knobs, each the references it takes or another kit knob of its kind; anything else is a type error at the call site (STYLEX.md).