Progress
A horizontal progress bar for displaying completion percentage (determinate) or indicating ongoing work without a known total (indeterminate).
Basic Usage
Determinate (known value)
Indeterminate (unknown duration)
Omit value to render an animated sliding bar for tasks with unknown duration.
Show Numeric Value
Renders: 2145 / 5000 next to the label.
Variants
The fill color signals semantic meaning:
Sizes
Radial (circular) progress
For a radial progress indicator — the ring shape for dashboards, stat tiles and compact metrics — use the dedicated Radial Progress component. It is the canonical radial progress in WireKit: size and intent options, threshold coloring that turns the ring warning/danger past a limit, and a required accessible name.
progress.circle is deprecated — use radial-progressDo not use progress.circle in new code: it duplicates
radial-progress under a second name. It keeps working
and gains nothing new. Migrate <x-wirekit::
to <x-wirekit::.
Its size carries over as it is: both take sm, md, lg and xl.
For an indeterminate ring, reach for the spinner — a radial
progress is determinate by definition.
Livewire Integration
Pass a reactive value — the bar animates smoothly on updates:
<x-wirekit::progress :value="$this->uploadPercent" label="Uploading file" show-value />
public int $uploadPercent = 0;
public function processChunk()
{
$this->uploadPercent = min(100, $this->uploadPercent + 10);
}
Width & Layout
The progress bar fills its parent width. Control the width with Tailwind classes directly on the component:
<x-wirekit::progress class="max-w-sm" :value="65" label="Upload" />
Height is controlled by the size prop (sm, md, lg).
Intent
intent is the canonical color axis (matching badge, button, and alert). variant keeps working as a back-compat alias; when both are present, intent wins.
Animated fill
animation adds optional motion to a determinate fill — the "work in flight"
affordance for uploads and streaming. stripes is the barber-pole; shimmer is a
single light sweep. Both are purely additive: the bar's value is unchanged, and the
motion is disabled under prefers-reduced-motion (stripes freeze but stay visible;
the shimmer sweep is removed).
Reduced Motion
WireKit disables all progress and skeleton animations when the user's OS has prefers-reduced-motion: reduce set. This is handled centrally in dist/ — no extra configuration needed.
Client-side values
value is a PHP prop, evaluated when the page renders. An upload percentage does not exist then — it arrives later, in Alpine state that Livewire events advance. Binding to the rendered element does not close that: x-bind:value sets a value attribute on a <div>, and nothing reads it, so the bar stays indeterminate, show-value prints nothing, and there is no aria-valuenow at all.
value-expression takes the name of a property in the surrounding Alpine scope and lets the component drive the bar, the readout and aria-valuenow from it:
Pass a property name, not an expression: value-expression="percent" rather than value-expression="percent * 2". The component resolves it through Alpine's scope chain, so it reads the state you already have without you wiring anything to the inner elements.
Why a name and not an expression. Under Alpine's CSP build there is no expression evaluator, so a computed binding goes inert — it is not evaluated, and nothing reports that. Passing a name keeps every calculation inside WireKit's own registered component, which the CSP build does allow — so value-expression works identically on both bundles.
No value yet is not zero. While the property is null, absent, empty or unparseable, the bar stays indeterminate and aria-valuenow is absent — a bar drawn at 0% would claim that no work has been done, which is a different statement from not knowing yet. An explicit 0 is a real value and renders as one.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
value |
numeric|null | null |
Current value (null = indeterminate) |
max |
numeric | 100 |
Maximum value the bar represents |
label |
string|null | null |
Visible text label above the bar |
showValue |
bool | false |
Show current / max next to label, in the page's language: 12.500 / 100.000 on a German page |
intent |
string | 'primary' |
The color axis: 'primary', 'accent' (alias of primary), 'success', 'warning', 'danger', 'info', 'neutral'. See Variants & Intents. |
variant |
string | 'primary' |
Back-compat alias for intent. New code should use intent. Its default comes from wirekit.components.progress.variant, which the Customization section below sets. |
size |
string | 'md' |
'sm', 'md', 'lg' |
valueExpression |
string|null | null |
The NAME of an Alpine property to read the value from, for a value that only exists in the browser. See Client-side values. |
animation |
string | 'none' |
Optional fill motion (determinate only): 'none', 'stripes', 'shimmer'. Disabled under prefers-reduced-motion. |
scope |
string|null | null |
Scoped personalization name |
Accessibility
role="progressbar"on the track — the WAI-ARIA progressbar role- The track is light and carries an edge in
--color-wk-border-strong, at 3:1 or more against the page in every preset, so where the bar ends, and how far the fill reaches, reads without the value as text (WCAG 1.4.11). The fill, in its intent's text tone, stands at 5:1 or more against the track. - Determinate: sets
aria-valuenow,aria-valuemin="0",aria-valuemax="{max}"— screen readers announce the current percentage - Indeterminate:
aria-valuenowis omitted (WAI-ARIA spec for unknown progress) aria-labelledbylinks the bar to its visible label whenlabelis set, so the label is part of the accessible name- Pass an
idwhen the bar lives in a polling region. The link between label and bar needs an id, and with noidof your own one is generated. That is fine for a bar rendered once — but awire:pollregion re-renders, and a generated id changes with it, so the accessible name is re-resolved on every poll. Anidyou supply stays put across renders. - The indeterminate animation respects
prefers-reduced-motion: users with reduced-motion settings see a static filled region instead of a sliding bar
Keyboard Interaction
This component is purely presentational and does not respond to keyboard input.
Pitfalls
- Don't leave a bar without a name. A bare
<x-wirekit::carriesprogress> role="progressbar", and a screen reader needs thelabelprop or anaria-labelto say what it measures. A label element beside it does not name it: a<label>names form controls only, and a progress bar is none.
Design Tokens
| Element | Token |
|---|---|
| Track background | --color-wk-bg-muted |
| Track edge | --color-wk-border-strong, never under 1px |
| Track radius | --radius-wk-full |
| Fill (accent) | --color-wk-accent-text |
| Fill (success) | --color-wk-success-text |
| Fill (warning) | --color-wk-warning-text |
| Fill (danger) | --color-wk-danger-text |
| Label color | --color-wk-text |
| Value color | --color-wk-text-muted |
| Transition | --transition-wk-duration |
Customization
Override defaults without publishing views via config/:
'components' => [
'progress' => [
'variant' => 'success',
'size' => 'sm',
],
],
Usage & Conventions
Prop conventions — this component uses one or more of the shared semantic prop names (
intent/variant/tone/surface). See Prop naming conventions for the canonical vocabulary, alias matrix, and decision tree.
Further Reading
- WAI-ARIA 1.2: the
progressbarrole — a meter is a different role, for a value within a known range that is not progress - MDN:
aria-valuenow - MDN:
prefers-reduced-motion