Loader says that something is on its way: a circle, a triangle and a square in the ink hop in turn (900 ms a cycle, at most five cycles, then still) beside a visible label ("Loading"). The label never moves. art takes the 3D kit's block loader in place of the glyphs.
Example#
Usage#
Use a loader when something is on its way and there is no shape to hold: a search, a render, an upload being processed. Three glyphs hop in turn beside a visible label, for five cycles at most, then stand still.
- The label never moves and is announced politely (
role="status"). arttakes the 3D kit'sBlockLoaderin place of the glyphs, for bigger moments.- Reduced motion shows the glyphs still.
- Content with a known shape loads behind a
Skeletoninstead.
Anatomy#
- Glyphs
data-mk-part="glyphs" - Label
data-mk-part="label"
Volume#
Reading layer: identical at every volume.
Quiet
LoadingSendingStudio
LoadingSendingPress
LoadingSendingRave
LoadingSending
Content#
- Say what is loading: "Rendering the cover", not just "Loading".
- A joke can go beside the loader at louder volumes; the label stays literal.
Do and don't#
Do
Don't
Accessibility#
- It is a polite
role="status"named by its visible label. - Reduced motion prints the glyphs still; the label says the same thing either way.
- The hop ends on its own, so it never runs as an endless loop (D-E3).
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 |
Props#
| Prop | Type | Default | Description |
|---|---|---|---|
label | string | "Loading" | Visible and announced (default "Loading"). |
size | "md" | "sm" | none | Glyph size: `sm` 16 px (inline), `md` 24 px (default). |
art | ReactElement<unknown, string | React.JSXElementConstructor<any>> | none | The 3D kit's block loader (or other art) in place of the three glyphs. |
Tokens#
System tokens (9)
--mk-ease-pop--mk-font-text--mk-space-2--mk-space-3--mk-text--mk-type-body-ui-leading--mk-type-body-ui-size--mk-type-label-leading--mk-type-label-size
Its own properties (3)
--mk-loader-cycle--mk-loader-cycles--mk-loader-glyph
Changelog#
Arrived in 0.9.0.
Breadcrumbs,Pagination(withpaginationRange),Count,ProgressBar(bar, segments, indeterminate),AvatarandAvatarGroup,Tick,EmptyState,Kbd,SkeletonandLoader. Read the whole entry