Skeleton
The shape of content that has not arrived yet.
{/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */}
The shape of content that has not arrived yet.
Import
import { Skeleton, SkeletonText } from "@ir/ui";Variants
| Axis | Options | Default |
|---|---|---|
shape | block · circle | block |
Props
| Prop | Type | Required | What it does |
|---|---|---|---|
lines | number | How many lines to stand in for. |
Do and don't
Match the shape and count of what is actually coming.
Don't — Show three generic grey bars where a table will land.
A skeleton is a promise about the layout. Break it and the page jumps, which is worse than having shown nothing.
Hide them (they already are) and announce the wait once on the region.
Don't — Let a screen reader meet twelve skeleton blocks.
Twelve empty boxes read out one at a time tells the person nothing about what is happening.
Show them only past about half a second, or keep the old content in place.
Don't — Flash skeletons for a request that usually takes 200ms.
A skeleton that appears and vanishes reads as a glitch. Below the threshold, nothing at all is calmer.
Use the button's loading state; save skeletons for content arriving.
Don't — Use a skeleton for a submit, a save, or an action in flight.
A skeleton says "this will be here shortly". An action has no shape to stand in for.
Render the frame for real and skeleton only what is loading.
Don't — Skeleton the nav, the page title and the buttons too.
Chrome is already known at render time. Greying it out makes the whole page look broken rather than busy.
Accessibility
- Always aria-hidden. A skeleton is a picture of content, and a screen reader reading twelve grey boxes has been told nothing.
- The container announces the wait once instead — aria-busy on the region, or a single polite live region saying "Loading dashboards". The skeletons stay silent underneath it.
- The pulse stops under prefers-reduced-motion via motion-reduce:animate-none, and the test asserts it.
Where it is drawn
Figma — structure from figma, measurements from code.