Meter
Gauge with color-coded fill zones (success, warning, error) set by `low`, `high` and `optimum` thresholds.
<arc-meter>Overview
Meter shows a value within a known range, like the native HTML <meter> element. It renders a rounded track with a fill bar. With a label, a header row shows the label on the left and the percentage on the right in monospace.
In the default zones mode, the fill color follows the HTML meter algorithm with three thresholds: low, high and optimum. When the optimum is in the high segment (battery level, say), values above high are green (success), values between low and high are yellow (warning), and values below low are red (error). When the optimum is in the low segment (an error count), it flips: low values are green and high values red. Without thresholds, the range is split into thirds.
mode="plain" uses one color, for a quantity that's neither good nor bad. mode="diverging" fills from center toward the value, each side in its own color, for a lean either way such as −1 to +1. The header then shows the signed value instead of a percentage.
Guidelines
Do
- Set `low`, `high` and `optimum` to match what good means for your data, such as an optimum near `max` for battery level
- Set a `label` so readers know what the meter measures and can read the percentage
- Use it for values in a known range: disk usage, battery level, signal strength, scores
- Explain what the color zones mean nearby, in text or a tooltip
Don't
- Don't use it for indeterminate progress or task completion. Use Progress
- Don't set `min` equal to or above `max`. The fill stays at 0%
- Don't use it for pass/fail states. Use a Badge or status indicator
Features
- `role="meter"` with `aria-valuenow`, `aria-valuemin` and `aria-valuemax`
- Fill width and color animate with the theme's base transition
- `value` is clamped between `min` and `max`
Preview
Usage
<arc-meter
label="Disk Usage"
value="72"
min="0"
max="100"
low="50"
high="80"
optimum="0"
></arc-meter>import { Meter } from '@arclux/arc-ui-react';
export default function Example() {
return (
<Meter
label="Disk Usage"
value={72}
min={0}
max={100}
low={50}
high={80}
optimum={0}
/>
);
}<script setup>
import { Meter } from '@arclux/arc-ui-vue';
</script>
<template>
<Meter
label="Disk Usage"
:value="72"
:min="0"
:max="100"
:low="50"
:high="80"
:optimum="0"
/>
</template><script>
import { Meter } from '@arclux/arc-ui-svelte';
</script>
<Meter
label="Disk Usage"
value={72}
min={0}
max={100}
low={50}
high={80}
optimum={0}
/>import { Component } from '@angular/core';
import { Meter } from '@arclux/arc-ui-angular';
@Component({
imports: [Meter],
template: `
<arc-meter
label="Disk Usage"
[value]="72"
[min]="0"
[max]="100"
[low]="50"
[high]="80"
[optimum]="0"
></arc-meter>
`,
})
export class MyComponent {}import { Meter } from '@arclux/arc-ui-solid';
export default function Example() {
return (
<Meter
label="Disk Usage"
value={72}
min={0}
max={100}
low={50}
high={80}
optimum={0}
/>
);
}import { Meter } from '@arclux/arc-ui-preact';
export default function Example() {
return (
<Meter
label="Disk Usage"
value={72}
min={0}
max={100}
low={50}
high={80}
optimum={0}
/>
);
}<!-- Auto-generated by @arclux/prism — do not edit manually -->
<!-- arc-meter — requires meter.css + tokens.css (or arc-ui.css) -->
<div class="arc-meter">
<div
class="meter"
role="meter"
aria-valuemin="Min"
aria-valuemax="Max"
aria-valuenow="Value"
aria-label="Label"
>
Label
<div class="meter__track">
<div
class="meter__fill meter__fill--"
style="width: %"
></div>
</div>
</div>
</div><!-- Auto-generated by @arclux/prism — do not edit manually -->
<!-- arc-meter — self-contained, no external CSS needed -->
<style>
@media (prefers-reduced-motion: reduce) {
.arc-meter *,
.arc-meter *::before,
.arc-meter *::after { animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important; }
}
</style>
<div class="arc-meter" style="display: block">
<div
style="display: flex; flex-direction: column; gap: 4px"
role="meter"
aria-valuemin="Min"
aria-valuemax="Max"
aria-valuenow="Value"
aria-label="Label"
>
Label
<div style="position: relative; width: 100%; height: 8px; background: rgb(26, 26, 80); border-radius: 9999px; overflow: hidden">
<div
style="width: %"
></div>
</div>
</div>
</div>API
labelstring''- Label text displayed in the header row alongside the current percentage.
valuenumber0- Current meter value. Clamped between
minandmax. Reflected as an attribute. minnumber0- Minimum value representing the left edge (empty) of the meter.
maxnumber100- Maximum value representing the right edge (full) of the meter.
lownumber0- Threshold below which the value is considered low. Used for color zone calculation.
highnumber0- Threshold above which the value is considered high. Used for color zone calculation.
optimumnumber0- The optimal value. Determines which end of the range is "good" for color zone logic.
mode'zones' | 'plain' | 'diverging''zones'- How the fill is coloured.
zones(the default) colours by the low/high/optimum thresholds in status colours.plainis one colour,--meter-fill(default the accent), for a quantity that is not good or bad.divergingfills fromcentertoward the value,--meter-belowon one side and--meter-aboveon the other (default chart series 1 and 2), for a lean either way, such as −1 to +1. centernumber0- The midpoint of a diverging meter. Defaults to halfway between
minandmax. Ignored by the other modes.