Feedback
Skeleton
The shape of content that is on its way.
On this page
A skeleton stands in for content that is on its way, in the shape it will have, so the page does not jump when it arrives. It is a chip-toned block that a soft band of light crosses. Skeletons in one block start one after another, so the light runs down the block as a single pass where the browser supports sibling-index(). Size each like the content it replaces. Content that is already there and is being fetched again is busy instead.
Skeleton
<div class="flex items-center gap-sm" aria-busy="true" aria-label="Loading member"> <span class="skeleton skeleton-circle w(40)" aria-hidden="true"></span> <div class="flex flex-col w-full text-sm" aria-hidden="true"> <span class="skeleton skeleton-text max-w(160)"></span> <span class="skeleton skeleton-text max-w(320)"></span> </div></div>#Shapes
skeletonalone is a block. Give it the height of an image, a chart or a card.skeleton-textis one line of text: as tall as the letters and centered in the line it stands for, so the real text lands on the same baseline grid. It follows the font size and line height around it.skeleton-circleis an avatar or an icon. Give it a width; the height follows.
A loading card
<article class="card max-w(320) mx-auto" aria-busy="true" aria-label="Loading project"> <span class="skeleton card-media" aria-hidden="true"></span> <div class="flex flex-col" aria-hidden="true"> <span class="skeleton skeleton-text max-w(160)"></span> <span class="skeleton skeleton-text"></span> <span class="skeleton skeleton-text max-w(240)"></span> </div></article>#Accessibility
- Hide skeletons with
aria-hidden="true"and mark the region they fill witharia-busy="true"and a label that says what is loading. - With reduced motion the band of light does not move; the shape alone says the content is pending.
- Show a skeleton only when a wait is likely to be noticed. For a short wait, show nothing; for a button, use
aria-busyand a spinner.
#Classes
| Class | Description |
|---|---|
skeleton | A placeholder block; give it the height of the image, chart or card it stands for |
skeleton-text | One line of text: as tall as the letters and centered in the line it stands for. With skeleton |
skeleton-circle | A circle for an avatar or an icon, sized by its width. With skeleton |