Skeleton
BetaData displayOpen in the workshop
The shape of content that is on its way, for loads over about 300 ms.
.xg-skeleton · --title --circle --blockExample and markup
Live, from xg-ui.css and xg-ui.js. Switch the brand and mode on the example itself, or for the whole site in the header.
Markup
<div class="xg-card" aria-busy="true" aria-label="Loading revenue">
<div class="xg-stack" aria-hidden="true" style="gap:12px">
<span class="xg-skeleton xg-skeleton--title">
</span>
<span class="xg-skeleton" style="width:30%;height:32px">
</span>
<span class="xg-skeleton xg-skeleton--block">
</span>
<div class="xg-row">
<span class="xg-skeleton xg-skeleton--circle">
</span>
<span class="xg-skeleton" style="flex:1">
</span>
</div>
</div>
</div>States
Hover, focus and pressed are forced here with .is-hover, .is-focus and .is-active so they can be seen side by side; in a product they come from :hover, :focus-visible and :active.
| State | Shape |
|---|---|
| Line | |
| Title | |
| Avatar | |
| Block |
When to use it
Use it for
first load of cards, tables and charts.
Not for
reloads of data already on screen (keep it and show a Spinner or progress).
Rules
- Match the real layout: same rows, same card sizes, so nothing jumps.
- The shimmer stops under reduced motion.
Accessibility
- The loading region gets aria-busy="true"; skeleton shapes are aria-hidden.
Every color pair this component uses is measured for both brands in light and dark on the Accessibility page.
Related
Also in Data display: Data table, Pagination, KPI card, Status badge, Tag, Avatar, Progress, Chart, Tooltip, Empty state, Spinner. Used in the patterns Loading, empty and error states.
Status Beta: usable; class names may still change in a minor release, with a note (see Releasing).