Placeholders made of the three shapes under one shared sweep; when data arrives each one morphs into its content, numbers count up, and empty or failed loads resolve in place.
Use it when you know the shape of what is loading: a list, a card grid or a table. Placeholders match the layout, share one sweep and turn into the content in place.
When not to use
When you do not know the layout use Loader. When you know the progress use Progress.
Use skeletons when you know the shape of what is loading: a list of orders, a grid of projects,
a table of invoices. The placeholders are the shapes of the coming layout: a ball for an
avatar or icon, pills for lines of text (as tall as the glyphs, centered in the line they
reserve), a tile for media and cards. One slow band of light crosses every placeholder of
the page together.
When loading turns false, each placeholder becomes its content at its place: the ball
becomes the avatar, the pill stretches or shrinks to the width of its line of text and dissolves
there, then the text fades in (never stretched, never drawn over a pill), the tile becomes the
image. Slots land in reading order, one cascade step
apart (capped at 0.6 s), each with a small put-down, so the page assembles rather than pops.
When you don't know the shape, use a Loader.
Numbers arrive counting: an amount in a list row or an end table column (or any value in
Skeleton.Count) rolls up from 0 to its value in its own format ("€0.00" to "€1,240.00") as its
pill hands over, inside a box already as wide as the final figure, so nothing shifts. The eye goes
to the figures, which is what a dashboard waits for. In dark themes the sweep is tinted with the
brand.
A load does not always end with content: empty and error give the root the two other
outcomes, so the placeholders resolve to a note or an alert with Retry at the same place.
A refetch shorter than 300 ms keeps the current content on screen, so a fast response never
flashes placeholders.
Empty and failed loads resolve in place. A string gets the built-in look (the empty note is
announced, the error is a role="alert" with a Retry button when onRetry is set); pass your
own node for anything richer:
<Skeleton.Root loading={isPending} preset="table" columns={columns} empty="No drafts. Invoices you save without sending wait here." error={isError && "The archive did not answer in time."} onRetry={() => refetch()}> {invoices?.map((invoice) => ( <Skeleton.TableRow key={invoice.id} cells={cellsOf(invoice)} /> ))}</Skeleton.Root>
A bare <Skeleton className="h-4 w-32" /> still renders a single block, as in shadcn.
list: rows of a 32 px ball, a title pill (60%), a meta pill (35%) and a right-aligned amount
pill (a string trailing counts up). Inboxes, activity feeds, order lists. Under 22rem the amount moves under the meta line.
card: an auto-fill grid (min 240 px) of cards: a 16:9 tile, a title, two lines, and a footer
ball with a short pill. Project grids, galleries.
table: a header (the column labels, or short pills) and rows of pills aligned to columns
({ width, align, header }, the same widths as your table); end columns get right-aligned
pills and values.
When the response has fewer rows than the placeholders (none for an empty view or an error),
the unmatched placeholder rows fade out in the first 40% of the morph and their space closes on
the calm spring, while the empty note or the error alert takes it. Here Drafts is empty and
Archived fails once, then answers on Retry.
An empty string is spoken through the same status once the load resolves; an error string
renders as role="alert". Pressing Retry moves focus to the root (tabIndex={-1} when
onRetry is set), so focus is not lost when the alert leaves, and Tab continues into the new
rows.
While a number counts up, the rolling digits are aria-hidden and the real value stays in the
accessibility tree underneath (transparent, never visibility: hidden).
Placeholders are aria-hidden and never focusable: Tab skips the loading region and reaches
the content once it is mounted. Arriving content does not steal focus; use onSettled to move
it if the load replaced the focused element.
The root is aria-busy while loading. A visually hidden role="status" speaks label once
when loading starts and doneLabel once it resolves; single slots are never announced.
The fill is muted-foreground laid over the surface (82% in light, 62% in dark) with a 1px ink
rim and a top highlight, so the shapes follow any shadcn theme and hold 3:1 against the page,
a card or a muted panel (non-text contrast), also at the centre of the sweep's band. The sweep never crosses real text: it leaves
before the content fades in to full contrast, and the content is never dimmed afterwards.
With reduced motion (the OS setting, or MotionKitProvider reducedMotion="always") there is no
sweep: the placeholders are static shapes with their rim and highlight. When the data arrives,
each placeholder fades out in place and its content fades in right after, all at once, with no
flight, no put-down and no counting (numbers appear at their value). The OS setting hides the sweep before hydration too.
The sweep is one CSS keyframe on transform, pinned to the document's time origin, so every
band on the page is in phase with no JavaScript per frame. It pauses off screen and in hidden
tabs and follows the global time scale; sweep={false} turns it off.
The hand-over measures each slot's content once when loading flips, then flies the
placeholder with compositor transforms and removes it once it has dissolved. Keep a root under a few dozen slots (a 8-row,
4-column table is 32).
Placeholders reserve the content's line boxes, so the hand-over has no layout shift.
A count writes its digits straight to one text node per frame (no React render per frame) for
under a second, then unmounts its rolling layer.
Peer dependency: motion (not counted in the size budget).
Technical sheet
Motion
calm
260 ms · bounce 0
lively
400 ms · bounce 0.3
playful
540 ms · bounce 0.45
Main spring of each temperament. Set it with the temperament prop or MotionKitProvider; the default is lively.
Size
Not measured yet · budget 6.0 kB gzip
Component and MotionKit helpers; excludes react, react-dom, motion.
Dependencies
motion · peer
Triggers
a loading state
Reduced motion
Placeholders are static shapes with no sweep; each one fades out in place and its content fades in right after, all at once, and numbers appear at their value.
Keyboard
No keyboard interaction of its own.
Browsers
Last 2 versions of Chrome, Edge, Firefox and Safari (iOS 16.4+)