Reference

Meter

A level against its range (<meter>): a disk's use, a password's strength. Past high: or under low: it says so in its colour; optimum: says which end is good.

Meter(value: Number, min: Number, max: Number, …)

Since 6.2.0

max

high

optimum

Disk: 72% used

Example

wf

state used = 0.72 Stack(gap: .sm) { Text("Disk: {used:.percent} used") Meter(value: used, max: 1, high: 0.9, optimum: 0, label: "Disk") Slider(bind: used, min: 0, max: 1, step: 0.01, label: "Used") }

Past its high mark

wf

Meter(value: 0.95, high: 0.9, label: "Memory")

Where high is good

wf

Meter(value: 82, min: 0, max: 100, low: 40, optimum: 100, label: "Battery")

Props

Props of Meter
PropTypeUnsetMeaning

value:

Number

0

The level, between min: and max: (the native <meter>'s value)

min:

Number

0

The bottom of the range

max:

Number

1

The top of the range

low:

Number

min:

Below this the level counts as low, and its colour says so

high:

Number

max:

Above this the level counts as high, and its colour says so

optimum:

Number

the middle of the range

The best level: which part of the range (low, middle, high) is drawn as good

label:

String

none

What it measures: its accessible name (aria-label)

Attribute families: global, aria, data. Plus the 22 universal props every element takes: animate:, exit:, speed:, duration:, delay:, easing:, stagger:, on:, count:, shared:, class:, ref:, drag:, dragGroup:, dropValue:, dropAxis:, dropInside:, roving:, trapFocus:, mount:, update:, cleanup:.

Flags and cases

A flag is written after the parentheses with a dot: a Bool prop, or a case of one of the element's enum props. A case the enum lacks is an error with a hint.

No flags of its own.

Events

Every element also takes the props, the events and the attribute families listed on every element.

Slots

It takes no slots.

Renders with the class wf-meter, stable across releases, so a stylesheet may target it.