Skeleton holds the place of content that is still loading: flat blocks on the sunken face in the content's shape (a 60 % title bar, a 40 % meta bar, body lines). It never shimmers or loops; it waits like a proof waiting for its ink. Shapes: text, card and row.
Example#
Usage#
Use a skeleton to hold the place of content that is still loading, in its shape: a card, a row, lines of text. It is flat and still: no shimmer, no loop, a proof waiting for its ink.
- Shapes.
text(lines),card(media, title and meta) androw(thumb, title and meta). - Short waits need nothing; a skeleton that flashes for 100 ms is worse than none.
- Unknown waits with no shape to hold are a
Loader.
Anatomy#
- Media
data-mk-part="media" - Title
data-mk-part="title" - Meta
data-mk-part="meta" - Line
data-mk-part="line"
Volume#
Reading layer: identical at every volume.
Quiet
Loading the Fernlight case studyLoadingStudio
Loading the Fernlight case studyLoadingPress
Loading the Fernlight case studyLoadingRave
Loading the Fernlight case studyLoading
Content#
- Skeletons carry no words. If the wait runs long, a visible line under it says what is loading.
Do and don't#
Do
Don't
A skeleton with a shimmer sweeping across it forever.
Accessibility#
- It is a polite status that says its
label("Loading") once; the blocks are hidden from assistive tech. - No motion of any kind, so nothing changes under reduced motion.
- Under more contrast every block gets a rule, so the shapes stay visible.
The colour pairs it prints, with their contrast on both papers:
It prints no text of its own (art layer or layout only), so it has no pair to check.
Props#
| Prop | Type | Default | Description |
|---|---|---|---|
shape | SkeletonShape | none | |
lines | number | 3 | Body lines under the title and meta bars (`text` and `card`, default 3). |
label | string | "Loading" | Announced once (default "Loading"). |
Tokens#
System tokens (7)
Its own properties (3)
--mk-skeleton-line--mk-skeleton-title-after--mk-skeleton-title-before
Changelog#
Arrived in 0.9.0.
Breadcrumbs,Pagination(withpaginationRange),Count,ProgressBar(bar, segments, indeterminate),AvatarandAvatarGroup,Tick,EmptyState,Kbd,SkeletonandLoader. Read the whole entry