Skeleton screens that look like your real UI — in every framework.
universal-skeleton scans the DOM you already have and paints grey placeholders over it, so the skeleton always mirrors the exact layout of your content. Plain HTML, React, Vue, Angular, Svelte or jQuery — one package, no adapters, no dependencies.
npm install universal-skeletonAda Lovelace
@ada
First programmer in history. Wrote the first algorithm for the Analytical Engine and pioneered computing.
Three ways to use it
The same engine powers all three APIs. Try each one live — every demo below runs the real library.
scan() — auto mode
Point SkeletonLoader.scan() at any element; it mirrors the real UI and restores it on destroy().
while() — async helper
Wraps a promise: skeleton in, skeleton out — even when the promise rejects. Optional minDuration.
Click the button — skeleton covers the card while the promise runs.
<skeleton-screen> — markup
Wrap your markup once, toggle the loading attribute from any framework code.
data-skeleton="circle" / "rect"
Eight effects, one option
shimmer, wave, pulse, fade, blink, sheen, bounce — or none. Pure CSS on the same scanned skeleton, switchable at runtime.
Everything included
Auto-scan the real DOM
Measures text, avatars, images, buttons and inputs with getBoundingClientRect, then mirrors their exact geometry — no placeholder JSX to write.
One Web Component
<skeleton-screen loading> works in every framework because custom elements are the one component format they all speak.
8 animation effects
shimmer, wave, pulse, fade, blink, sheen, bounce and none — switchable at runtime via setEffect().
data-skeleton attributes
Force circles, rectangles, text bars or exclude subtrees with plain HTML attributes — zero configuration code.
Light, dark & auto themes
Skeleton blocks follow prefers-color-scheme automatically, or force a palette with the theme option and setTheme().
Responsive by default
A ResizeObserver rebuilds the skeleton whenever the layout changes — resize the window and it keeps mirroring.
Accessible out of the box
aria-busy on the scanned region, aria-hidden on the overlay, blocks phantom clicks, honors prefers-reduced-motion.
TypeScript-ready
Ships with .d.ts declarations and JSX typings — full IntelliSense in TS projects, no @types package needed.
Runs anywhere the DOM runs
No adapters, no peer dependencies: it only talks to the browser. If your stack renders HTML — server templates included — it works.
Ship loaders that fit your UI — not grey boxes that don't.
One install, one attribute, every framework. Start with the quick start — the first skeleton takes about a minute.
npm install universal-skeleton