Component API

<progress-bar>

Open live example

A determinate horizontal progress indicator — a page-level "step 3 of 14"
bar. stat-meter is the closest existing thing but is an inline
CPU-gauge-style meter with a leading label and a computed percent value;
progress-bar instead takes a raw value/max pair and renders an
optional plain-text label to the right of the bar rather than a percent
inside it.

Install

import "@f-ewald/components/progress-bar.js";

Usage

<progress-bar value="3" max="14" label="Question 3 out of 14"></progress-bar>
<progress-bar value="7" max="10" color="#dc2626" track-color="#fecaca"></progress-bar>

Attributes / properties

PropertyAttributeTypeDefaultDescription
valuevaluenumber0Current progress. Clamped into [0, max].
maxmaxnumber100Value representing a full bar.
labellabelstring""Optional text rendered to the right of the bar (e.g. "Question 3 out of 14").
colorcolorstring""Fill color; defaults to the themed accent.
trackColortrack-colorstring""Track color behind the fill.

Events

None.

Slots

None.

CSS custom properties

Custom property
--ui-button-accent
--ui-font
--ui-font-size-sm
--ui-numeric
--ui-primary
--ui-radius-sm
--ui-surface-muted
--ui-text-muted