Meter
Read-only gauge for displaying a bounded numeric value.
Meter renders a read-only bounded value with role="meter" and ARIA value metadata. Its slots expose the label, value, track, and indicator.
Use Progress for task completion and Slider for editable values.
Anatomy
#label: Custom visible label.#value: Custom formatted value text.#indicator: Custom content inside the filled indicator.
The role="meter" root and track are generated by the component. The root sets --akaza-meter-percentage, and thresholds expose data-akaza-state as low, normal, high, or optimum.
Usage
Examples
Basic gauge
Use a basic meter for a read-only value inside a known min/max range.
import './main.css'
Threshold states
Use low, high, and optimum to expose state for styling.
<template>
<Accordion
:items="items"
type="multiple"
/>
</template>
Formatted value
Use locale and formatOptions for displayed value text.
<Dialog
:ui="{
overlay: 'fixed inset-0 bg-black/50',
content: 'fixed left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 rounded-lg bg-white p-6',
}"
/>
Custom accessible value text
Use getAriaValueText when the numeric value needs a human-readable screen reader label.
/* Target by semantic class */
.akaza-dialog-overlay { background: rgba(0, 0, 0, 0.5); }
.akaza-dialog-content { border-radius: 12px; }
/* Target by state */
[data-akaza-state="open"] { opacity: 1; }
[data-akaza-state="checked"] { background: black; }
/* Target by positioning side */
.akaza-tooltip-content[data-akaza-side="top"] { margin-bottom: 8px; }
Custom slots
Slots receive value, formatted value, percentage, and state where relevant.
@layer akaza-reset;
@import "tailwindcss";
@import "akaza-ui/dist/akaza-ui.css";
Region State
Values below low use low; values above high use high; values between the thresholds use normal. When optimum is supplied, the region containing it uses optimum instead. These describe regions, not prescribed success or error colors. Provide finite, ordered bounds and thresholds.
API Reference
Props
| Prop | Type | Default | Description |
|---|---|---|---|
value | number | required | Current value. |
min | number | 0 | Minimum value. |
max | number | 100 | Maximum value. |
low | number | — | Low threshold. Values below set data-akaza-state="low". |
high | number | — | High threshold. Values above set data-akaza-state="high". |
optimum | number | — | Preferred range hint. |
label | string | — | Visible label. Also labels the meter. |
ariaLabel | string | — | Accessible label when no visible label exists. |
ariaLabelledby | string | label id | Accessible label id. |
ariaValueText | string | — | Custom aria-valuetext. |
locale | Intl.LocalesArgument | runtime locale | Locale for formatted value. |
formatOptions | Intl.NumberFormatOptions | — | Number formatting options. |
getAriaValueText | (value, max, min) => string | undefined | — | Base-style function for aria-valuetext. |
getValueLabel | (formattedValue, value) => string | undefined | — | Function for aria-valuetext. |
ui | MeterUi | — | Classes for structural parts. |
UI Options
| Key | Description |
|---|---|
root | Root meter element. |
label | Label text. |
value | Formatted value text. |
track | Meter track. |
indicator | Filled indicator. |
Slots
| Slot | Props | Description |
|---|---|---|
label | value, formattedValue, state | Custom label. |
value | value, formattedValue, percentage, state | Custom formatted value. |
indicator | value, percentage, state | Custom indicator content. |
Styling Hooks
| UI key | CSS class | Data attrs |
|---|---|---|
root | akaza-meter | data-akaza-state |
label | akaza-meter-label | — |
value | akaza-meter-value | — |
track | akaza-meter-track | — |
indicator | akaza-meter-indicator | data-akaza-state |
Meter sets --akaza-meter-percentage on the root. Plain class applies to the root meter.