Skeleton
A placeholder in the shape of content still loading: lines of text, a circle or a block.
Stability: experimental
Props
| Prop | Type | Default | Means |
|---|---|---|---|
shape | "line" | "circle" | "block" | "line" | Lines of text, a circle (an avatar), or a block (an image or a card). |
lines | number | 1 | For lines: how many; the last of several is shorter. |
width | "full" | "3/4" | "1/2" | "1/3" | "full" | For lines: how much of the width they take. |
size | "sm" | "md" | "lg" | "md" | For a circle, 32, 48 or 72 points across; for a block, 96, 160 or 240 points tall. |
label | string | Announced once, politely, such as "Loading posts". Give it to one skeleton of a screen, not each. |
States
| State | Looks like |
|---|---|
shimmering | A soft highlight sweeps across the raised shape every 1.4 seconds. |
reduced motion | No shimmer: a still raised shape. |
Accessibility
| role | none of its own; with a label, a status holding the label as visually hidden text |
| name | The label prop, when given. |
| focus | Never focusable. |
| notes | The shimmer stops when the device asks for reduced motion (prefers-reduced-motion). |
Theme tokens
color.raised color.surface space.2 radius.sm radius.md radius.full
Example
<Skeleton shape="circle" label="Loading the profile" /><Skeleton lines={3} />