// preview in
saved for every page

Meter

Shows a measurement inside a known range, like storage used, seats taken or password strength. For a task that moves toward done, like an upload, use Progress.

Built on Base UIPattern WAI-ARIA meterClient componentSource ↗
minimal · light · #3fa34d
Storage
x
tone
showValue

Installation

Set up Camaleo once (Installation), then import what you need. The skin you load styles it.

import { Meter } from "@camaleo/react";

Anatomy

A root with a header (label and value) and a track with the fill. Every part has a data-slot you can target from CSS.

trackindicatorStorage 64.2 of 100 GB
[data-slot="meter"][data-slot="meter-track"] · [data-slot="meter-indicator"]label · value

Examples

Every example is a real file you can copy. They all wear the skin, mode and brand from the bar above.

minimal · light · #3fa34d
Storage64.2 of 100 GB
x

Meter: how full something is

Storage180 of 256 GB
x

Progress: how far a task has gone

Uploading backup.zip
x

Meter or Progress?

Meter says how full something is, and the value can go up or down. Progress says how far a task has gone, and it only moves toward done.

Photo storage42% · OK
x
Emails sent this month78% · Close to the limit
x
API calls today94% · Almost used up
x

Tones for status

brand when all is well, warning when it gets close to the limit, danger when people need to act. Say it in the text too, not only in color.

Mailbox6 of 15 GB · Plenty of space
x

Warn before it's full

Click to add files. Pick the tone from the value, so the meter turns warning at 75% and danger when the mailbox is full.

Active users this month8,450 of 10,000
x

In the real unit

Set max to the real limit and show "8,450 of 10,000". People think in users and gigabytes, not in percent.

Seats7 of 10 seats
x

Seats, in words

getAriaValueText lets screen readers say "7 of 10 seats used" instead of "70 percent".

Meeting room temperature24 °C
x

A range that doesn't start at zero

Use min and max for scales like temperature. The fill shows where 24 °C sits between 16 and 32.

Storage

Files, photos and email share your 15 GB.

Storage used12.4 of 15 GB
x

In a settings row

Put the meter next to the action that fixes it. "Free up space" right by the number saves people a search.

In context

Meters sit where people check their limits. These are whole pieces of UI you can copy, in the skin you picked.

Team seats

Your Pro plan includes 20 seats.

Seats in use18 of 20 seats
x
Team seatsCard · Meter · Button

Create a password

Use at least 12 characters, with numbers and symbols.

Password strengthStrong
x
Password strengthCard · Label · Input · Meter

Server resources

Processor34%
x
Memory12.8 of 16 GB
x
Disk300 of 512 GB
x
Server resourcesCard · Meter

Guidelines

Disk space780 MB of 1 GB
x
DoMeasure something with a limit.

Disk space, seats, monthly emails: a value and a known maximum.

Uploading file78%
x
Don’tA meter for an upload.

An upload is a task with an end. Use Progress, so screen readers announce a progress bar.

Database connections85 of 100 connections
x
DoShow the value and the limit.

"85 of 100 connections" tells people how much room is left.

Database85
x
Don’tA number with no unit.

85 what? Percent, megabytes or users? People can't tell whether to worry.

Props

PropTypeDefaultDescription
labelReactNode—Visible label; also names the meter for assistive tech.
showValuebooleantrueShow the formatted value next to the label.
valueLabelReactNode—Replaces the visible value text, for example "18 of 20 seats". It only changes what is shown: pass getAriaValueText so screen readers hear the same thing.
toneMeterTone"brand"Semantic tone of the indicator bar.
formatIntl.NumberFormatOptions—Options to format the value.
getAriaValueText(formattedValue, value) => string—The text screen readers hear for the value. Defaults to the percentage.
localeIntl.LocalesArgument—The locale used by Intl.NumberFormat when formatting the value. Defaults to the user's runtime locale.
maxnumber100The maximum value
minnumber0The minimum value
value*number—The current measurement, between min and max.

Other Base UI meter root props and native <div> attributes pass through.

Styling hooks

Attributes

data-tonebrand · warning · danger
data-slot"meter" · "meter-track" · "meter-indicator"

Tokens it reads

Color

--cml-accent-text--cml-border-control--cml-danger--cml-fg--cml-fg-secondary--cml-surface--cml-warning

Shape & size

--cml-border-width--cml-gap--cml-radius-pill

Type & motion

--cml-duration-base--cml-ease-standard--cml-font-label

This component only

--cml-meter-border--cml-meter-height--cml-meter-radius

Accessibility

—Not focusable. It shows a value; the controls around it take the focus.
Was this page helpful? · Edit this page on GitHub