ProgressBar shows how far a task has come. A visible label is required, and the value prints beside it in words. bar is a 12 px sunken track filled in the selected ink; segments counts up to 12 cells, done cells in the selected ink. indeterminate prints a still, hatched track and "Working…": there is no loop.
Example#
Usage#
Use a progress bar to show how far a task has come: an upload, screens approved, a render. A visible label is required and the value prints beside it in words.
bar(default) is a 12 px sunken track filled in the selected ink.segmentscounts up to 12 cells, for steps people count, such as screens approved.indeterminateprints a still, hatched track and "Working…". It never loops (D-E3).
Anatomy#
- Head
data-mk-part="head" - Label
data-mk-part="label" - Value
data-mk-part="value" - Track
data-mk-part="track"
Volume#
Reading layer: identical at every volume.
Quiet
Studio
Press
Rave
Content#
- The label names the task: "Upload", "Screens approved".
valueTextsays it in the reader's terms: "7 of 9 screens", not "77.7 %".
Do and don't#
Do
Don't
Accessibility#
role="progressbar"named by the label, witharia-valuetextin the same words the bar prints.- Nothing animates: the fill is set once per render, so reduced motion changes nothing.
- Done and open cells differ by face and rule weight as well as ink.
The colour pairs it prints, with their contrast on both papers:
| Text | Surface | Role | Bone | Night |
|---|---|---|---|---|
--mk-text | --mk-surface | ui | not in this look | not in this look |
--mk-text-2 | --mk-surface | ui | not in this look | not in this look |
Props#
| Prop | Type | Default | Description |
|---|---|---|---|
label required | string | none | Visible and the bar's name. |
value | number | none | |
max | number | 100 | Default 100. |
valueText | string | "{n} %", or "{value} of {max}" for segments | The words for the value (default "{n} %", or "{value} of {max}" for segments). |
appearance | "bar" | "segments" | none | |
indeterminate | boolean | none | No known value: a still hatched track and `indeterminateText`. |
indeterminateText | string | none | Default "Working…". |
Tokens#
System tokens (17)
--mk-border--mk-control-rule--mk-font-text--mk-radius-pill--mk-selected--mk-space-1--mk-space-2--mk-space-4--mk-surface-sunken--mk-text--mk-text-2--mk-type-field-label-leading--mk-type-field-label-size--mk-type-field-label-weight--mk-type-meta-leading--mk-type-meta-size--mk-type-meta-weight
Its own properties (2)
--mk-progress--mk-progress-gap
Changelog#
Arrived in 0.9.0.
Breadcrumbs,Pagination(withpaginationRange),Count,ProgressBar(bar, segments, indeterminate),AvatarandAvatarGroup,Tick,EmptyState,Kbd,SkeletonandLoader. Read the whole entry