Skeleton
Content-shaped loading placeholders with a shared shimmer and stable layout dimensions.
Purpose
Use Skeleton to reserve the approximate shape of content while a layout is loading and the final value is not yet available.
Loading layout
Installation
With the Siteplane registry alias configured, add the component and import the installed source from your app.
CLI
pnpm dlx shadcn@4.16.1 add @siteplane/skeletonImport
import { Skeleton } from "@/components/ui/skeleton";Need the machine-readable source metadata? View registry JSON.
Usage
Skeleton reserves space for loading content. Match the final layout instead of showing generic bars everywhere.
import { Skeleton } from "@/components/ui/skeleton";
export function Example() {
return <Skeleton className="h-8 w-48" />;
}Examples
Shapes come from className; loading layouts add aria-busy containers and a real skeleton-to-content switch.
Shapes
Lines, blocks, avatars and button placeholders are the same primitive with different className shapes.
Card loading
aria-busy on the container announces the loading state; the skeletons themselves stay hidden.
Table row
User card loading
Cards switch from skeleton to loaded content after a delay; Reload restarts the cycle.
API Reference
The reference lists the source-owned exports and props that are easy to miss in visual examples. Inherited Base UI props remain available unless the wrapper narrows them.
Skeletonaccepts standarddivprops. Set its dimensions and shape with existing layout and radius utilities.- The primitive owns
data-slot="skeleton"and the shared shimmer animation; it does not introduce content-specific variants.
Motion
Component motion uses the shared Siteplane motion contract. See the global motion guide for provider setup, tokens and reduced-motion behavior.
- Skeleton uses the central
animate-skeletonshimmer. Both the provider override and the operating-system reduced-motion preference stop it through the sharedsiteplane-skeleton-motioncontract. - Do not add a second animation, fixed background attachment or component-local timing values.
Accessibility
- Keep placeholders hidden from the accessibility tree when they carry no meaningful status.
- Announce loading on the surrounding region when users need that information; do not expose fake text or fake controls to screen readers.
- Preserve layout without making the placeholder look interactive.
Implementation Guidance
- Shape Skeleton with normal layout utilities instead of adding parallel variants or wrappers.
- Use Spinner for an indeterminate operation indicator and Skeleton for content-shaped loading.
- Remove the placeholder when real content arrives rather than layering both states.