Meter

Loading...

Installation

Add the component with the CLI.

npx shadcn@latest add @intentui/meter

Manual installation

Install the dependencies, then copy the component source into your project.

npm install react-aria-components cn

Anatomy

import { Meter } from "@/components/ui/meter"

<Meter label="Storage space" value={32} />

Examples

Decimal format

The meter displays a percentage by default. Use formatOptions to change the number format. This example uses decimal formatting.

Loading...

Currency format

Use formatOptions to display the value as a currency amount.

Loading...

Component API

Meter

Meter extends the React Aria Components <Meter> component.

classNamestring

MeterHeader

MeterHeader extends the native <div> element.

classNamestring

MeterTrack

MeterTrack extends the native <div> element.

classNamestring

MeterValue

MeterValue extends the native <span> element.

classNamestring

See the React Aria for the full API reference.

Design