UI Components

Meter

A short meter, nol-meter, for how much of a limit is used, such as an account's usage in a settings list: a short rounded bar filled to its fraction, with its content after it as muted text, such as 42% · Nov 2. Its warning tone turns the bar and the text to the theme's warning color, for use near the limit. It is a meter named by its label, with its fraction from 0 to 1 as its value and its text as the value's text, or, without text, the fraction as a percentage in the app's locale, so it is never read as a bare fraction; under forced colors the bar is outlined and filled in CanvasText. The bar's width, height and the gap before the text are the theme's meter, meter-height and meter-gap sizes.

Examples

Loading…

States

Loading…

API

Selector nol-meter

Import from @noldova/ui.components.angular

Inputs

NameTypeDefaultDescription
labelstring Required

The meter's accessible name, naming what it measures, such as Weekly usage.

valuenumber0

The fraction used, from 0 to 1; a value outside that range shows as the nearer end, and one that is not a number as 0. 0 when not bound.

warningbooleanfalse

Whether the meter shows its warning tone, the bar and its text in the theme's warning color, such as near the limit; under forced colors it looks the same, so the text says why. False when not bound.

Accessibility

It takes no keys of its own.

It has the meter role, named by its label, with its fraction from 0 to 1 as its value.

Its text is the value's text, so it is read as it shows; without text, the fraction is read as a percentage in the app's locale, never as a bare fraction.

A value above 1 or below 0 shows and is read as the nearer end, and one that is not a number as 0.

The warning tone changes only its color, so its text says that the limit is near.

Specification

Loading…