ProgressBar
Linear progress indicator with label, percentage display, colour variants, stripes, animation, and segmented display.
Basic Progress
Upload progress65%
Custom Value/Max
Tasks: 3 of 560%
Colour Variants
Primary80%
Success100%
Warning55%
Danger30%
Striped
Striped pattern70%
Animated
Animated stripes50%
Segmented Progress
Display multiple segments in a single progress bar, each with its own color.
Project Status0%
Storage: 800 GB / 1 TB
JavaScript API
Read and update progress values dynamically with JavaScript.
Controlled progress40%
Use the buttons above to control the progress bar...
PHP PHP Methods (Fluent)
| Method / Property | Parameters | Description |
|---|---|---|
$m->progressBar($id) | string | Create a ProgressBar component. |
->value($v) | float | Current progress value (min: 0). |
->max($m) | float | Maximum value (default: 100, min: 1). |
->label($text) | string | Text label shown above the bar. |
->showPercent($show) | bool | Show percentage next to the label (default: false). |
->variant($v) | string | Colour: primary, success, warning, danger, purple. |
->primary() | | Shorthand for ->variant('primary'). |
->success() | | Shorthand for ->variant('success'). |
->warning() | | Shorthand for ->variant('warning'). |
->danger() | | Shorthand for ->variant('danger'). |
->striped($s) | bool | Add diagonal stripe pattern. |
->animated($a) | bool | Animate stripes (requires ->striped()). |
->segments($segs) | array | Array of segments: [['value' => 30, 'variant' => 'success', 'label' => 'Done'], ...] |
JS JS Methods
| Method / Property | Parameters | Description |
|---|---|---|
m.progressBar(id) | string | Get ProgressBar instance. |
getValue() | | Returns current value as float. |
getMax() | | Returns max value as float. |
getPercent() | | Returns percentage (0-100). |
setValue(val, animate) | number, ?bool | Set value. animate defaults to true. |
setMax(max) | number | Set max value and recalculate percentage. |
increment(amount) | ?number | Add to value (default: 1). |
decrement(amount) | ?number | Subtract from value (default: 1). |
complete() | | Set to max (100%). |
reset() | | Set to 0. |
EVENT Events
| Event Name | Detail | Description |
|---|---|---|
m:progressbar:change | {oldValue, newValue, percent, max} | Fired when value changes. |
m:progressbar:complete | {value} | Fired when complete() is called. |
m:progressbar:reset | {} | Fired when reset() is called. |