Skip to contentKino
Skip to Content

Meter

A measurement in a known range, such as storage or seats, as a fill on a thin track. Past its high mark, or below its low mark, the fill and the value turn red, and a notch shows where that mark is.

npx shadcn add https://kinoui.com/r/meter.json
Share on

Examples

Workspace storage

Pro plan · 5 GB
Storage used
x

Exports older than 90 days are removed for you.

Default

Put a MeterLabel and a MeterValue inside, and they sit in a row above the track. Set high, and past it the fill and the value turn red; a notch marks where.

Plan usage

Resets on 1 December
Seats
x
MCAOKWLF+8 more
AI credits
x
Guests
x

Several

Stack meters for the limits of a plan. Each value changes in place: the fill draws to it and never moves on its own.

Installation

npx shadcn@latest add https://kinoui.com/r/meter.json
Files
lib/reduce-motion.tslib/track.tscomponents/kino/meter.tsx
Packages
@base-ui/react

New to Kino? Installation covers what your project needs first and the @kino namespace.

API reference

Meter

PropTypeDefaultDescription
valuenumberNoneThe measurement.
minnumber0The lowest value.
maxnumber100The highest value.
highnumberNonePast this value the meter warns: the fill and the value turn red, and a notch on the track marks it.
lownumberNoneBelow this value the meter warns as it does past high, for a measure that should stay high, such as battery or a password’s strength.
formatIntl.NumberFormatOptionsNoneHow MeterValue and the value read out are written. A percentage by default.
aria-labelstringNoneNames a meter that has no MeterLabel.
getAriaValueText(formattedValue, value) => stringNoneWhat a screen reader reads for the value, such as "3.2 GB of 5 GB".

Data attributes

AttributeOnDescription
data-highMeterPresent while the value is past high.
data-lowMeterPresent while the value is below low.

Accessibility

  • It is a meter, named by MeterLabel or by aria-label. Use it for a measurement, never for how far a task has got: that is a Progress.
  • The value in the row is for sighted users and is hidden from screen readers, which read the meter itself. Write it with getAriaValueText when a percentage would say less.
  • Past high or below low, red is not the only sign: the fill passes the notch. Say what it means in text too, such as "Almost full".
  • In forced colours the fill takes the system highlight and the track gets an outline.
  • When the system asks for less motion, the fill jumps to a new value.