Progress

Material Design 3 linear and circular progress indicators and a usage meter, as web components.

  • 3.1 KB gzipped
  • @lit-material/progress 0.2.0
  • Renders on the server

Example

Install

npm install @lit-material/progress @lit-material/tokens
import "@lit-material/progress";

Link @lit-material/tokens/css/index.css once per page for the colour, type and shape tokens. Install guide

API

<lit-material-circular-progress>

Material Design 3 circular progress indicator.

Properties

PropertyAttributeTypeDefaultDescription
valuevaluenumber0
maxmaxnumber1
indeterminateindeterminatebooleanfalse
sizesizenumber48Diameter in pixels.
strokeWidthstroke-widthnumber4

CSS parts

PartDescription
trackThe background ring.
indicatorThe filled arc.

<lit-material-linear-progress>

Material Design 3 linear progress indicator.

Properties

PropertyAttributeTypeDefaultDescription
valuevaluenumber0
maxmaxnumber1
indeterminateindeterminatebooleanfalse

CSS parts

PartDescription
trackThe background track.
indicatorThe filled indicator bar(s).

<lit-material-usage-meter>

How much of a limit is used: a labelled bar with the value and limit in text, e.g. a quota ("CPU 3.2 of 4 cores") or disk ("12 of 20 GiB").

Properties

PropertyAttributeTypeDefaultDescription
labellabelstring""What is measured, e.g. "CPU".
valuevaluenumber0Amount used.
maxmaxnumber0The limit; 0 means none.
unitunitstring""Unit after the numbers, e.g. "GiB" or "cores".
warningwarningnumber0.8Fraction of max from which the meter warns.
criticalcriticalnumber0.95Fraction of max from which the meter is critical.
formatproperty only(n: number) => stringnoneFormats both numbers; default: up to two decimals in the page's locale.
levellevelUsageLevel""warning, critical or "", from the value; reflected for styling.

CSS parts

PartDescription
labelThe label.
valueThe "used of limit" text.
barThe track.
indicatorThe filled part.

CSS custom properties

PropertyDescription
--lit-material-usage-meter-colorThe bar below warning (default --md-sys-color-primary).
--lit-material-usage-meter-warning-colorThe bar from warning on.
--lit-material-usage-meter-critical-colorThe bar from critical on (default --md-sys-color-error).
--lit-material-usage-meter-track-colorThe empty track (default --md-sys-color-surface-container-highest).
--lit-material-usage-meter-heightBar thickness (default 8px).

Source on GitHub npm