Skip to content

CSS: progress

.instui-progress · stable — A determinate progress bar with a coloured meter, sizes, and an optional value label.

.value is a sibling of .bar, both children of the root — mirroring how progress-circle nests its own .value part. InstUI has no indeterminate state; :indeterminate is a pantoken-only best guess (native <progress> without a value attribute), animating .bar as a sliding segment and hiding .value since there's no meaningful number to show. <meter> has no indeterminate state, so it's unaffected.

Source: progress.css

Accessibility

Use native <progress> for a zero-based task completion range and <meter> when the minimum is non-zero. Give either element an accessible name by nesting it in <label> or associating a separate <label> through matching for and id values.

Usage

css
@import "@pantoken/components/components.css";
@import "@pantoken/components/progress.css";

Examples

Nested label

html
<label>
  Uploading Document: <progress class="instui-progress -color-brand" value="70">70%</progress>
</label>

External label

html
<label for="storage-used">Storage used</label>
<meter id="storage-used" class="instui-progress -color-warning" min="20" value="40" max="60">50%</meter>

Structure

// Variant: nested-label

text
label
  .instui-progress
    .bar
    .value

// Variant: external-label

text
label
.instui-progress
  .bar
  .value
flowchart TD subgraph sg0 ["nested-label"] n1["label"]:::cssdoc-root n2(".instui-progress"):::cssdoc-part n3(".bar"):::cssdoc-part n4(".value"):::cssdoc-part end subgraph sg5 ["external-label"] n6["label"]:::cssdoc-root n7[".instui-progress"]:::cssdoc-root n8(".bar"):::cssdoc-part n9(".value"):::cssdoc-part end n2 --> n3 n2 --> n4 n1 --> n2 n7 --> n8 n7 --> n9 classDef cssdoc-root stroke-width:1px; classDef cssdoc-part stroke-width:1px; classDef cssdoc-slot stroke-width:1px; classDef cssdoc-component stroke-width:1px;

Modifiers

ModifierDescription
.-color-brandBrand meter colour.
.-color-dangerDanger meter colour.
.-color-infoInformational meter colour.
.-color-inverseFor dark backgrounds.
.-color-primary-inverseOn-dark (primary inverse) meter colour.
.-color-successSuccess meter colour.
.-color-warningWarning meter colour.
.-meter-color-alertDeprecated — use .-color-warning.
.-meter-color-brandDeprecated — use .-color-brand.
.-meter-color-dangerDeprecated — use .-color-danger.
.-meter-color-infoDeprecated — use .-color-info.
.-meter-color-successDeprecated — use .-color-success.
.-meter-color-warningDeprecated — use .-color-warning.
.-render-value-insideRenders .value inside the track, aligned to its start, instead of beside it; style it for legibility over the meter colour.
.-should-animateInteraction — Animate meter changes over half a second.
.-size-largeLarge. Long-form alias of -size-lg.
.-size-lgLarge.
.-size-mdMedium (default).
.-size-mediumMedium (default). Long-form alias of -size-md.
.-size-smSmall.
.-size-smallSmall. Long-form alias of -size-sm.
.-size-x-smallExtra small. Long-form alias of -size-xs.
.-size-xsExtra small.

Parts

PartDescription
.barThe filled meter bar.
.valueThe value text beside the bar.

Pseudo-elements

Pseudo-elementDescription
:::indeterminateCustom, not part of InstUI. Applies only to a native <progress> missing its value attribute; animates .bar as a sliding segment and hides .value.
::afterDraws the track's bottom rule as its own layer over the meter, so the full border and the bottom border stay independent across themes.

States

StateDescription
:indeterminate

Custom properties

PropertyTypeDefaultDescription
--max<number>The maximum progress value (default 100).
--min<number>The minimum meter value (default 0).
--value<number>The current progress value.
--value-max<number>@alias {@link --max} The maximum progress value (default 100).
--value-now<number>@alias Alias for --value.

Animations

AnimationDescription
pantoken-progress-indeterminate

Tokens consumed

TokenTypeValue
--instui-color-background-brand<color>LightDarklight-dark(#1D354F, #EEF4FD)
--instui-color-background-error<color>#E62429
--instui-color-background-info<color>#2B7ABC
--instui-color-background-success<color>#03893D
--instui-color-background-warning<color>#CF4A00
--instui-component-progress-bar-border-color<color>LightDarklight-dark(#1D354F, #EEF4FD)
--instui-component-progress-bar-border-color-inverse<color>LightDarklight-dark(#ffffff, #6A7883)
--instui-component-progress-bar-border-radius<length>0.5rem
--instui-component-progress-bar-font-family[ <font-family-name> | <generic-font-family> ]#Atkinson Hyperlegible Next, "Helvetica Neue", Helvetica, Arial, sans-serif
--instui-component-progress-bar-font-weight<integer>400
--instui-component-progress-bar-large-height<length>2rem
--instui-component-progress-bar-line-height<percentage>125%
--instui-component-progress-bar-medium-height<length>1.5rem
--instui-component-progress-bar-medium-value-font-size<length>1rem
--instui-component-progress-bar-meter-color-brand-inverse<color>LightDarklight-dark(#ffffff, #10141A)
--instui-component-progress-bar-small-height<length>1rem
--instui-component-progress-bar-text-color<color>LightDarklight-dark(#576773, #AAB0B5)
--instui-component-progress-bar-text-color-inverse<color>LightDarklight-dark(#ffffff, #1C222B)
--instui-component-progress-bar-track-bottom-border-color<color>#00000000
--instui-component-progress-bar-track-bottom-border-color-inverse<color>#00000000
--instui-component-progress-bar-track-bottom-border-width<length>0.0625rem
--instui-component-progress-bar-track-color<color>#00000000
--instui-component-progress-bar-track-color-inverse<color>#00000000
--instui-component-progress-bar-value-padding<length>0.5rem
--instui-component-progress-bar-x-small-height<length>0.5rem

Browser support

  • Scopes the meter part rules with the @scope at-rule; browsers without @scope support ignore those scoped rules.