Meter
A meter component for displaying a scalar value within a known range. Supports low, high, and optimum thresholds for contextual coloring.
Basic
Thresholds
Use the low, high, and optimum props to define value ranges that affect the meter appearance.
Colors
Props
| Prop | Type | Default | Description |
|---|---|---|---|
value | number | — | The current meter value. |
min | number | 0 | Minimum value. |
max | number | 100 | Maximum value. |
low | number | — | The upper bound of the low range. |
high | number | — | The lower bound of the high range. |
optimum | number | — | The optimal value within the range. |
color | "blue" | "red" | "green" | "yellow" | "purple" | "neutral" | string | "blue" | Accent color for the meter fill. |
label | string | — | Label displayed above the meter. |
showValue | boolean | false | Displays the current value next to the label. |
--mantle-bg | CSS variable | theme default | Override the background color via style. e.g. style={{ "--mantle-bg": "#1a1a2e" }} |
--mantle-border | CSS variable | theme default | Override the border color via style. Set to "transparent" to remove. e.g. style={{ "--mantle-border": "#e94560" }} |
--mantle-text | CSS variable | theme default | Override the text color via style. e.g. style={{ "--mantle-text": "#ffffff" }} |
--mantle-ring | CSS variable | accent | Override the focus ring color via style. e.g. style={{ "--mantle-ring": "#e94560" }} |
valuenumberThe current meter value.
min0numberMinimum value.
max100numberMaximum value.
lownumberThe upper bound of the low range.
highnumberThe lower bound of the high range.
optimumnumberThe optimal value within the range.
color"blue""blue" | "red" | "green" | "yellow" | "purple" | "neutral" | stringAccent color for the meter fill.
labelstringLabel displayed above the meter.
showValuefalsebooleanDisplays the current value next to the label.
--mantle-bgtheme defaultCSS variableOverride the background color via style. e.g. style={{ "--mantle-bg": "#1a1a2e" }}
--mantle-bordertheme defaultCSS variableOverride the border color via style. Set to "transparent" to remove. e.g. style={{ "--mantle-border": "#e94560" }}
--mantle-texttheme defaultCSS variableOverride the text color via style. e.g. style={{ "--mantle-text": "#ffffff" }}
--mantle-ringaccentCSS variableOverride the focus ring color via style. e.g. style={{ "--mantle-ring": "#e94560" }}