1. Documentation
  2. Feedback
  3. Meter
ReadmenpmGitHub
  • Introduction
  • Installation
  • Theming
  • Icons
  • Accordion
  • Card
  • Scroll Area
  • Separator
  • Sidebar
  • Field
  • Label
  • Input
  • Textarea
  • Number Field
  • OTP Field
  • Select
  • Combobox
  • Checkbox
  • Radio
  • Switch
  • Slider
  • Toggle
  • Calendar
  • Date Picker
  • File Upload
  • Button
  • Copy Button
  • Dropdown
  • Command
  • Tabs
  • Breadcrumb
  • Pagination
  • Tree
  • Table
  • Data Table
  • Stat
  • Timeline
  • Avatar
  • Status Bar
  • Badge
  • Meter
  • Empty
  • Skeleton
  • Spinner
  • Toast
  • Dialog
  • Sheet
  • Popover
  • Tooltip
  • Text
  • Kbd
  • Code Block
  • Utilities
  • Design rules

Meter

A measurement inside a known range — quota, disk, capacity, budget. There is no separate Progress.

Loading documentation…

Badge< PreviousEmptyNext >

Powered by heyo

On this page

UsageTonesSizes and rangesInside a statProperties
Storage68%
x
<Meter label="Storage" value={68} showValue />

Meter reports a value inside a known range. There is deliberately no Progress component: a task with a percentage is still just a measurement, and one bar that always means the same thing beats two that look identical and are chosen by accident.

Usage

tsx
import { Meter } from "@heyo-sh/heyo-ui";<Meter label="Storage" value={68} showValue />;

Tones

The tone is yours to pick, because only your application knows when 80% is fine and when it is an incident.

Requests32%
x
Bandwidth58%
x
Build minutes74%
x
Quota96%
x
<Meter label="Requests" value={32} tone="neutral" showValue /><Meter label="Bandwidth" value={58} tone="brand" showValue /><Meter label="Build minutes" value={74} tone="warning" showValue /><Meter label="Quota" value={96} tone="danger" showValue />

Sizes and ranges

min and max set the range — a meter is not required to be a percentage. format controls how showValue prints it.

x
Memory75%
x
x
<Meter size="sm" value={40} /><Meter size="base" label="Memory" value={384} min={0} max={512} showValue /><Meter size="lg" value={88} tone="success" />

Inside a stat

A meter is small enough to be a stat's chart, which is the usual way a quota appears on a dashboard.

Storage
6.8GB of 10 GB
x
<Statborderedlabel="Storage"value="6.8"unit="GB of 10 GB"chart={<Meter value={68} size="sm" tone="brand" />}/>

Properties

valuenumberrequired

The measurement.

min / maxnumberoptional

The range. They default to 0 and 100.

labelReactNodeoptional

The row above the track.

showValuebooleanoptional

Prints the value at the right end of the label row.

formatIntl.NumberFormatOptionsoptional

How the printed value is formatted.

size"sm" | "base" | "lg"optional

Track height: 4, 6 or 10px. It defaults to base.

tone"neutral" | "brand" | "success" | "warning" | "danger"optional

The fill colour. It defaults to neutral.

classNamestringoptional

Merged into the root.