Presets

Skeleton loader CSS

A placeholder card with a shimmer passing over the avatar and text lines while content loads.

CSSTailwindReactGIFMP4
trigger: loop
00.000 / 1.600s
timing
style

npm i motion · the component uses motion/react

How it works

A skeleton loader shows the outline of content before the content exists. This one mimics a comment or list row: a 44px round avatar on the left and three text lines on the right that get shorter (100%, 78%, 56%), so it looks like a real paragraph rather than three identical blocks.

Each shape is painted with the same linear-gradient: Base color, then Shimmer color in the middle, then Base color again, with background-size at 300%. A keyframe named shimmer moves background-position from 100% to 0%, which drags the lighter band across the shape. Since every placeholder runs the same timing, the band appears to pass over the whole card together.

Skeletons work best when the final layout is predictable: feeds, search results, profile headers, tables. They reduce perceived wait because the page structure arrives first. Parameters are Width, Base color, Shimmer color, Duration and Easing. Keep the two colors close (the defaults differ by only a few shades); a high-contrast shimmer looks like flashing. A Duration of 1.4 to 2s feels calm.

Animating background-position triggers a repaint of each placeholder every frame rather than running on the compositor. For a handful of rows that cost is negligible, but for a 50-row table consider a single shimmer overlay moved with transform. The root has role="status" and aria-label="Loading content"; set aria-busy="true" on the region being filled and remove it when data arrives.

How do I match the skeleton to my real layout?

Copy the code and edit the shapes, not the animation. Keep the gradient and shimmer keyframe on a shared class, then add or resize blocks so they match your card: a wide rectangle for an image, narrow lines for metadata. Using the same widths and gaps as the loaded component prevents a layout jump when content replaces the placeholder.

Can I make a Tailwind loading skeleton from this?

Yes. Pick the Tailwind tab: the shapes become utility classes with the gradient as an arbitrary background value, and the shimmer keyframe is provided for @theme in Tailwind v4 or for tailwind.config.js in v3. Tailwind's built-in animate-pulse fades opacity instead, which is simpler but lacks the moving highlight.

Should I disable the shimmer for reduced motion?

It is a good idea. Wrap the animation in @media (prefers-reduced-motion: no-preference), or set animation: none inside a reduce query. The gray shapes still communicate that content is loading, so nothing is lost for users who turned motion off. The same applies to the React version through Motion's useReducedMotion hook.

relatedMore like this

all loaders →
01 Spinner loop
02 Dual ring loop
03 Bouncing dots loop
04 Typing indicator loop
05 Equalizer bars loop
06 Progress bar loop

Export

format
height

480p max · small watermark · 3 per day · remove limits