Skeleton
Holds the shape of content while it loads, so the layout doesn't jump.
When to use
- Content is loading into a layout you already know: a list, a card, a profile.
- The wait is short, and the page should not jump when the content arrives.
When not to use
- An action in progress, such as saving: use Spinner in the button.
- A task with a known length, such as an upload: use Progress.
- There is nothing to load: use Empty.
Install
npx shadcn@latest add @clinia/skeletonClinia rules
- The block is
bg-foreground/8withrounded-lg. Match its size and radius to the content it stands in for. - The pulse stops under
prefers-reduced-motion, like every other animation.
Do and don't
Accessibility
Your responsibility
- Skeletons are empty
divelements and say nothing. Setaria-busy="true"on the loading region, and addsr-onlytext such asLoading sources. - When the content arrives, remove the skeletons, the text and
aria-busytogether.
How to test
- Turn on reduced motion in the OS: the pulse stops.
- With a screen reader, the loading text is read, and the skeletons stay silent.
- Throttle the network: when the content loads, the layout doesn't shift.
API
Every prop comes from the native div element.