Data
Meter <pm-meter>
Meter: a measurement within a known range, such as storage used, a score or password strength. For the progress of a task, use <pm-progress>.
Sizes
Set with the size attribute; controls keep touch-sized targets on phones.
size="sm"size="md"size="lg"Overview
With low, high and optimum the bar is coloured like the native <meter>: green in the best region, amber next to it, red furthest away. Without them it uses the tone. segments splits the bar into equal steps.
Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
value | number | 0 | Current value. |
min | number | 0 | Lowest allowed value. |
max | number | 100 | Highest allowed value. |
low | number | — | Upper end of the low region. |
high | number | — | Lower end of the high region. |
optimum | number | — | The best value; decides which regions are good. |
label | string | — | Accessible name (and visible label where the component shows one). |
value-textprop: valueText | string | — | Text for the value, shown and announced (e.g. "72 GB of 100 GB", "Strong"). |
size | 'sm' | 'md' | 'lg' | — | Size: sm, md or lg (md when not set). |
segments | number | — | Split the bar into this many equal steps. |
hide-valueprop: hideValue | boolean | — | Hide the value text beside the label (it is still announced). |
Also accepts the contextual attributes tone, surface, radius, density, motion, elevation. They are inherited from ancestors' data-* attributes.
Slots
| Slot | Description |
|---|---|
(default) | Text under the bar (a hint or legend). |