Skeleton UI
A loading pattern that displays low-fidelity layout placeholders before real data arrives, reducing perceived wait time and layout shift
Table of Contents
Interactive Playground
Tap or drag to interact with the demoWhat is Skeleton UI?
A loading pattern that displays low-fidelity layout placeholders before real data arrives, reducing perceived wait time and layout shift. It is a core concept in UI Components within UI / UX.
Core Principles
A Skeleton UI (or Skeleton Screen) replaces blank screens and generic spinners with low-fidelity wireframe blocks that mirror the shape of incoming content—thumbnails, avatars, and text lines. Because users immediately see where information will appear, their attention shifts from waiting to anticipating, dramatically improving perceived performance even when raw network latency is unchanged.
Equally important, reserving the exact bounding boxes ahead of time prevents Cumulative Layout Shift (CLS) when asynchronous images and text hydrate onto the page.
Practical Takeaways
- Match real component geometry: If a skeleton card is shorter or taller than the hydrated component, the page will jump when data arrives. Share the same grid tracks, padding, and
aspect-ratiotokens between the skeleton and the real view. - Choose the right threshold: For responses under ~200–300ms, flashing a skeleton feels jarring—delay its appearance slightly or skip it. For long operations exceeding 5–10 seconds (like video encoding or file uploads), pair or replace skeletons with determinate progress indicators.
- Keep shimmer subtle and accessible: Use a gentle left-to-right wave (1.5–2s), respect
prefers-reduced-motionby falling back to a static tint, and exposearia-busy="true"for assistive technologies.
Notable Examples
- YouTube, LinkedIn, and Facebook feeds: Instant card shells with avatar circles and two-line title bars keep scrolling seamless.
- E-commerce product grids: Preserving catalog row structure during filter changes prevents disorienting white flashes.
- Next.js
loading.tsxand React Suspense: Streaming server-rendered sections that progressively swap individual skeleton boundaries for live data.
Practical Code Snippet
Copy and drop straight into your project.skeleton { border-radius: 8px; background: linear-gradient( 90deg, var(--surface) 25%, var(--surface-subtle) 50%, var(--surface) 75% ); background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite;} @keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; }}