Tac UIv1.1.2

Meter

Displays a scalar measurement within a known range, such as storage usage, score, or quota consumption.

Import

tsx
import { Meter } from '@tac-ui/web';

Playground

Interactively configure the Meter props below.

Usage50%
tsx
<Meter value={50} label="Usage" />

Default

A basic meter showing a labeled value with a percentage display.

Storage used42%
tsx
<Meter value={42} label="Storage used" />

Various Values

The meter bar color changes based on the fill level — green under 60%, yellow between 60–80%, and red above 80%.

Low usage25%
Moderate usage50%
High usage75%
Critical usage95%
tsx
<Meter value={25} label="Low usage" />
<Meter value={50} label="Moderate usage" />
<Meter value={75} label="High usage" />
<Meter value={95} label="Critical usage" />

Custom Value

Use customValue to display a formatted string instead of the default percentage.

Storage7.2 GB / 10 GB
Rating3 / 5 stars
tsx
<Meter value={72} label="Storage" customValue="7.2 GB / 10 GB" />
<Meter value={3} min={0} max={5} label="Rating" customValue="3 / 5 stars" />

Hidden Value

Set showValue to false to hide the value text and display only the label and bar.

Progress
tsx
<Meter value={60} label="Progress" showValue={false} />

Meter vs Progress

Use Meter to represent a static scalar value within a known range (e.g., storage, scores). Use Progress to indicate the completion status of an ongoing operation (e.g., file upload, loading).

API Reference

PropTypeDefaultDescription
valuenumber-Current meter value.
minnumber0Minimum value of the range.
maxnumber100Maximum value of the range.
labelstring-Label displayed to the left of the value.
customValuestring-Custom display text for the value. When omitted, shows percentage.
showValuebooleantrueWhen true, displays the value/percentage to the right of the label.
classNamestring-Additional CSS class names.