Skeleton

Skeleton

Skeletons are shimmering placeholders shown while content loads. Hide them from assistive tech with aria-hidden and mark the loading region with aria-busy.

Playground

Flip a class and watch it change. The markup below follows along.

Modifiers
<div class="skeleton" aria-hidden="true" style="block-size: 4rem"></div>

Class names

Class nameTypeDescription
skeletonComponentShimmering block; set its size yourself
skeleton-textModifierOne line of text: 1em tall, full width
skeleton-circleModifierRound 3rem placeholder for avatars

Skeleton

A bare skeleton has no intrinsic height; give it a block size.

<div class="skeleton" aria-hidden="true" style="block-size: 4rem"></div>

Text

<div aria-busy="true" style="display: grid; gap: 0.5rem">
  <div class="skeleton skeleton-text" aria-hidden="true"></div>
  <div class="skeleton skeleton-text" aria-hidden="true" style="inline-size: 70%"></div>
</div>

Circle

<div class="skeleton skeleton-circle" aria-hidden="true"></div>

Custom size

Set inline-size and block-size to match the content it replaces.

<div class="skeleton" aria-hidden="true" style="inline-size: 12rem; block-size: 2.5rem"></div>

Card placeholder

Wrap the placeholders in a region with aria-busy="true"; swap it for real content when loaded.

<div aria-busy="true" style="display: grid; gap: 0.75rem; max-inline-size: 20rem">
  <div class="skeleton skeleton-circle" aria-hidden="true"></div>
  <div class="skeleton skeleton-text" aria-hidden="true"></div>
  <div class="skeleton skeleton-text" aria-hidden="true" style="inline-size: 80%"></div>
  <div class="skeleton" aria-hidden="true" style="block-size: 6rem"></div>
</div>