Component

Skeleton Loader

Shimmering placeholder skeletons that match the shape of incoming content - card image, avatar, title, and text lines, plus a list-row variant. Pure CSS shimmer animation with prefers-reduced-motion support.

  • Component
  • Tailwind
  • HTML
  • MIT

Preview

Live component

Interactive preview
Open preview
9:41 100%
devsnips.dev/library/tailwind/components/progress/skeleton-loader/
fluid · no fixed width 100%
No dependencies Reduced-motion

Install

Add to your project

terminal
npx devsnips add Tailwind/Components/Progress/skeleton-loader
registry path: Tailwind/Components/Progress/skeleton-loader

Source

Implementation

code.html
<!--
Snippet Name: Skeleton Loader
Description: Shimmering placeholder skeleton for loading content - card image, title, lines, and avatar. Pure CSS shimmer animation.
Author: DevSnips Contributors
Usage Example: Show while fetching data; swap in real content once loaded. Toggle .skeleton-loaded to reveal.
-->
<div class="skeleton-card w-full max-w-sm overflow-hidden rounded-2xl border border-gray-200 bg-white shadow-sm" role="status" aria-live="polite" aria-label="Loading content">
  <div class="skeleton-shimmer relative h-40 w-full bg-gray-200"></div>
  <div class="space-y-4 p-5">
    <div class="flex items-center gap-3">
      <div class="skeleton-shimmer h-10 w-10 rounded-full bg-gray-200"></div>
      <div class="flex-1 space-y-2">
        <div class="skeleton-shimmer h-3 w-1/2 rounded bg-gray-200"></div>
        <div class="skeleton-shimmer h-3 w-1/3 rounded bg-gray-200"></div>
      </div>
    </div>
    <div class="space-y-2">
      <div class="skeleton-shimmer h-3 w-full rounded bg-gray-200"></div>
      <div class="skeleton-shimmer h-3 w-full rounded bg-gray-200"></div>
      <div class="skeleton-shimmer h-3 w-2/3 rounded bg-gray-200"></div>
    </div>
  </div>
</div>

<style>
  .skeleton-shimmer {
    background-image: linear-gradient(90deg, rgb(229 231 235) 25%, rgb(243 244 246) 37%, rgb(229 231 235) 63%);
    background-size: 400% 100%;
    animation: skeleton-shimmer 1.4s ease infinite;
  }
  @keyframes skeleton-shimmer {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
  }
  @media (prefers-reduced-motion: reduce) {
    .skeleton-shimmer { animation: none; }
  }
</style>
38 lines UTF-8 · LF · Spaces: 2

AI-ready

Available to your agent.

This component is reachable through the DevSnips CLI, MCP server and Skills integrations — one registry, one resource path.

Resource path

devsnips://components/progress/skeleton-loader

Continue browsing

View all