v1.1.0 · MIT · zero dependencies

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-skeleton
loading — skeleton is mirroring the real UI
Profile banner
Avatar

Ada Lovelace

@ada

First programmer in history. Wrote the first algorithm for the Analytical Engine and pioneered computing.

312 posts8.2k following129k followers
0
runtime dependencies
~4.4 KB
gzipped CDN build
8
animation effects
18+
stacks it works with

Three ways to use it

The same engine powers all three APIs. Try each one live — every demo below runs the real library.

1

scan() — auto mode

Point SkeletonLoader.scan() at any element; it mirrors the real UI and restores it on destroy().

2

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.

3

<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.

shimmer
wave
fade
bounce

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.

Plain HTMLReactNext.jsVue 3NuxtAngularSvelteSvelteKitLitjQueryAstroRemixSolidhtmxRailsDjangoPHPWordPress

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