Skip to content

Early previewhamur is not on npm yet. The components are being built in the open, follow along on GitHub.

UIComponentsReact

Meter

A bar that shows a measurement within a known range, such as storage used.

Built on the headless Meter.See its API in Docs

Rendered by React 19.3.1

meter.tsx

Installation

npx shadcn@4.23.0 add https://hamur.dev/r/react/meter.json

It also adds utils. The app needs its setup first: Installation.

Usage

Pass value (0 to 100 by default, or set min and max). Meter renders its track and indicator itself after its children, as Progress does, so MeterLabel and MeterValue go inside it. Use a Meter for a level that can go up and down, and a Progress for a task moving to its end. The meter role and its values come from the headless Meter.

import {
  Meter,
  MeterIndicator,
  MeterLabel,
  MeterTrack,
  MeterValue,
} from '@/components/ui/meter'

Examples

Default

Storage used, with its label and value.

Its preview and code are at the top of the page.

shadcn/ui has no Meter, so this item takes Base UI's component ID as its slug and one name per Base UI part. Its look follows shadcn's Progress.

API reference

The styled parts pass every prop to the headless part they wrap and add classes. The props, data attributes and keyboard are on Meter's API reference.