Searching Puzzle Pieces

Type to search Puzzle Pieces.

Meter

A semantic gauge (role="meter") for a measured value within a range, colored by sentiment against low/high thresholds. Distinct from Progress, which reports task completion rather than a measurement.

Disk usage72% used

Installation

Copy the piece into your app — it compiles with your build and the code is yours:

puzzle add piece meter

Requires the pieces.css tokens merged into your app styles (see Introduction), including the --color-warning sentiment token used for the caution band.

Usage

import Meter from '@/components/ui/Meter.pzl';
<Meter value={ disk } low={ 60 } high={ 85 } optimum={ 0 } label="Disk usage" valueText={ `${disk}% used` }/>

Bands

Success band20% — plenty of room
Warning band72% — getting full
Danger band95% — nearly full

Custom range

Memory26 GB / 32 GB

Formatted value text

Battery pack7.2 kWh / 10 kWh

Sizes

Small40
Medium40