Fine-tune light, shadows, borders, neumorphic
Light and shadows
Borders
Neumorphic
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>.

Full screen

Props

<script type="module"> import '@prismora/css'; import '@prismora/elements/meter'; </script> <pm-meter label="Storage" value="72" low="60" high="85" optimum="20" value-text="72 GB of 100 GB"></pm-meter> <pm-meter label="Password strength" value="3" max="4" segments="4" low="1.5" high="2.5" optimum="4" value-text="Strong"></pm-meter>

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

AttributeTypeDefaultDescription
valuenumber0Current value.
minnumber0Lowest allowed value.
maxnumber100Highest allowed value.
lownumber—Upper end of the low region.
highnumber—Lower end of the high region.
optimumnumber—The best value; decides which regions are good.
labelstring—Accessible name (and visible label where the component shows one).
value-text
prop: 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).
segmentsnumber—Split the bar into this many equal steps.
hide-value
prop: 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

SlotDescription
(default)Text under the bar (a hint or legend).

Used in templates

Billing and invoices