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
@import "@pantoken/components/components.css";
@import "@pantoken/components/progress.css";Examples
Nested label
<label>
Uploading Document: <progress class="instui-progress -color-brand" value="70">70%</progress>
</label>External label
<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
label
.instui-progress
.bar
.value// Variant: external-label
label
.instui-progress
.bar
.valueModifiers
| Modifier | Description |
|---|---|
.-color-brand | Brand meter colour. |
.-color-danger | Danger meter colour. |
.-color-info | Informational meter colour. |
.-color-inverse | For dark backgrounds. |
.-color-primary-inverse | On-dark (primary inverse) meter colour. |
.-color-success | Success meter colour. |
.-color-warning | Warning meter colour. |
.-meter-color-alert | Deprecated — use .-color-warning. |
.-meter-color-brand | Deprecated — use .-color-brand. |
.-meter-color-danger | Deprecated — use .-color-danger. |
.-meter-color-info | Deprecated — use .-color-info. |
.-meter-color-success | Deprecated — use .-color-success. |
.-meter-color-warning | Deprecated — use .-color-warning. |
.-render-value-inside | Renders .value inside the track, aligned to its start, instead of beside it; style it for legibility over the meter colour. |
.-should-animate | Interaction — Animate meter changes over half a second. |
.-size-large | Large. Long-form alias of -size-lg. |
.-size-lg | Large. |
.-size-md | Medium (default). |
.-size-medium | Medium (default). Long-form alias of -size-md. |
.-size-sm | Small. |
.-size-small | Small. Long-form alias of -size-sm. |
.-size-x-small | Extra small. Long-form alias of -size-xs. |
.-size-xs | Extra small. |
Parts
| Part | Description |
|---|---|
.bar | The filled meter bar. |
.value | The value text beside the bar. |
Pseudo-elements
| Pseudo-element | Description |
|---|---|
:::indeterminate | Custom, not part of InstUI. Applies only to a native <progress> missing its value attribute; animates .bar as a sliding segment and hides .value. |
::after | Draws 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
| State | Description |
|---|---|
:indeterminate | — |
Custom properties
| Property | Type | Default | Description |
|---|---|---|---|
--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
| Animation | Description |
|---|---|
pantoken-progress-indeterminate | — |
Tokens consumed
| Token | Type | Value |
|---|---|---|
--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
@scopeat-rule; browsers without@scopesupport ignore those scoped rules.
Related
- progress-circle — The circular form of the same determinate progress.