Skeleton
A skeleton draws the layout of content that is still on its way, such as the rows of a list or the lines of a message. The page appears at once, and the content takes each shape's place as it arrives.
Example
When to use it
Use a skeleton when you know the shape of what is coming, such as a list of candidates or the notes of an interview. Draw only what changes with the data: the toolbar and the column headers show from the start.
Work of a known size takes a progress bar, and a wait inside a button takes a spinner. A page that shows a skeleton shows no spinner as well.
Anatomy
Each shape stands for one element at its real size, such as a line of text or an avatar. Rows keep the height of the real rows, so nothing moves when the content lands.
- Fill, light theme
- Ink mixed 22 percent into the card
- --skeleton-fill
- Fill, dark theme
- Ink mixed 16 percent into the card
- --skeleton-fill
- Line of text
- 12 px high
- Line corner radius
- 4 px
- --radius-sm
- Paragraph
- Lines at 80, 67 and 60 percent of the width
- Space between lines
- 8 px
- --space-2
- Avatar
- A circle at the avatar's size
- Row
- The height of the real row
Motion
The whole skeleton pulses together, fading to half strength and back, so no shape runs ahead of another. With reduced motion, the shapes stay still.
- Pulse
- Opacity 100 to 50 percent and back
- Cycle
- 2,000 ms
- Easing
- cubic-bezier(0.4, 0, 0.6, 1)
Behavior
Content replaces each shape where it stands. When one part arrives before the rest, it takes its own place and the other shapes keep pulsing.
When the content turns out to be empty, the skeleton gives way to the empty state. When the load fails, it gives way to the error and Try again. After 10 seconds the skeleton stays, and a message above it says what is still loading.
Accessibility
The shapes are hidden from screen readers. The loading region is marked busy and holds one visually hidden sentence, such as “Loading candidates”, which a screen reader hears once.
When the content arrives, focus stays where it was.
Permitted and not permitted
Permitted
Skeleton rows at the height of the real rows
The list does not jump when the content lands.
Not permitted
A white shimmer on a white page
Nobody can see it, so the page looks broken, not busy.
A skeleton of the tabs and the toolbar
They do not depend on the data. Show them from the start.