Meter
Displays a scalar measurement within a known range. Use low / high / optimum thresholds to colour the fill based on whether the value is in an optimal, suboptimal, or critical zone.
import { Meter } from "@brijbyte/agentic-ui/meter";
import "@brijbyte/agentic-ui/meter.css";
export default function BasicDemo() {
return (
<div style={{ display: "flex", flexDirection: "column", gap: "var(--space-4)", width: "100%" }}>
<Meter value={24} label="Storage used" showValue format={{ style: "percent", maximumFractionDigits: 0 }} />
<Meter value={68} label="Memory" showValue />
<Meter value={91} label="CPU" showValue />
</div>
);
}
import { Meter } from "@brijbyte/agentic-ui/meter";
import "@brijbyte/agentic-ui/meter.css";
export default function SizesDemo() {
return (
<div style={{ display: "flex", flexDirection: "column", gap: "var(--space-4)", width: "100%" }}>
<Meter value={60} size="sm" label="Small" showValue />
<Meter value={60} size="md" label="Medium" showValue />
<Meter value={60} size="lg" label="Large" showValue />
</div>
);
}
Meter
base-ui docs ↗Displays a scalar measurement within a known range. Use low / high /optimum thresholds to colour the fill based on whether the value is in
an optimal, suboptimal, or critical zone.
| Prop | Type | Default |
|---|---|---|
| value* | number | — |
Current value. Must be between | ||
| min | number | 0 |
Minimum value of the range. | ||
| max | number | 100 |
Maximum value of the range. | ||
| low | number | — |
Upper boundary of the low zone. Values ≤ this are "low". | ||
| high | number | — |
Lower boundary of the high zone. Values ≥ this are "high". | ||
| optimum | "low" | "mid" | "high" | high |
Which zone is optimal — determines fill colour:
| ||
| label | ReactNode | — |
Accessible + visible label. | ||
| showValue | boolean | false |
Show the formatted value next to the label. | ||
| format | NumberFormatOptions | — |
| ||
| showTicks | boolean | false |
Show tick marks at low/high threshold positions. | ||
| size | "sm" | "md" | "lg" | md |
Bar thickness. | ||
| className | string | — |
Styled Parts
base-ui docs ↗Pre-styled wrappers around the corresponding base-ui parts. All base-ui props are forwarded.
CSS Class Names
Available as keys on the MeterStyles object. Each key maps to a hashed CSS module class name at runtime.
circular-centercircular-indicatorcircular-labelcircular-lgcircular-mdcircular-rootcircular-smcircular-svgcircular-trackcircular-valueindicatorlabellabel-rowrootticktracktrack-lgtrack-mdtrack-smvalue