Skip to content

Meter

Display a numeric value within a known range.

Demos

Size
Storage used64

Usage

vue
<script setup lang="ts">
import { Accordion } from '~/components/ui/accordion'

const items = [
  { value: 'source', label: 'Do I own the source?', content: 'Yes. Copy and adapt the files.' },
]
</script>

<template>
  <Accordion :items="items" />
</template>

Value changes animate the bar width over 200ms. Reduced motion applies the new value immediately. Use Options and states to change value, bounds, and thresholds.

Installation

Complete the shared installation. Copy Meter.vue and index.ts into app/components/ui/meter/.

API

Variants and defaults

PropValuesDefault
sizexs, sm, md, lg, xlsm

Props

PropTypeDefaultDescription
valuenumberrequiredCurrent value.
minnumber0Minimum value.
maxnumber100Maximum value.
lownumber—Low threshold. Values below set data-akaza-state="low".
highnumber—High threshold. Values above set data-akaza-state="high".
optimumnumber—Preferred range hint.
labelstring—Visible label. Also labels the meter.
ariaLabelstring—Accessible label when no visible label exists.
ariaLabelledbystringlabel idAccessible label id.
ariaValueTextstring—Custom aria-valuetext.
localeIntl.LocalesArgumentruntime localeLocale for formatted value.
formatOptionsIntl.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.
uiMeterUi—Classes for structural parts.

Slots

SlotPropsDescription
labelvalue, formattedValue, stateCustom label.
valuevalue, formattedValue, percentage, stateCustom formatted value.
indicatorvalue, percentage, stateCustom indicator content.