Skip to main content
The Skeleton component provides a visual placeholder while content is loading, with support for pulse, shimmer, and gradient animations.

Installation

npx shadcn@latest add @eo-n/skeleton

Usage

import { Skeleton } from "@/components/ui/skeleton";
<Skeleton className="h-12 w-64" />

Examples

Pulse (Default)

The default variant with a subtle pulse animation:
<Skeleton className="h-4 w-48" />

Shimmer

A shimmer effect that sweeps across the skeleton:
<Skeleton variant="shimmer" className="h-4 w-48" />

Gradient

A gradient animation that flows across the skeleton:
<Skeleton variant="gradient" className="h-4 w-48" />

Card Skeleton

<div className="space-y-3">
  <Skeleton className="h-32 w-full rounded-lg" />
  <div className="space-y-2">
    <Skeleton className="h-4 w-3/4" />
    <Skeleton className="h-4 w-1/2" />
  </div>
</div>

Avatar Skeleton

<div className="flex items-center space-x-4">
  <Skeleton className="size-12 rounded-full" />
  <div className="space-y-2">
    <Skeleton className="h-4 w-48" />
    <Skeleton className="h-3 w-32" />
  </div>
</div>

Table Skeleton

<div className="space-y-2">
  <Skeleton className="h-10 w-full" />
  <Skeleton className="h-10 w-full" />
  <Skeleton className="h-10 w-full" />
  <Skeleton className="h-10 w-full" />
</div>

Component API

Skeleton

variant
'pulse' | 'shimmer' | 'gradient'
The animation variant to use.
  • pulse - Default pulsing opacity animation
  • shimmer - Sweeping shimmer effect
  • gradient - Flowing gradient animation
className
string
Additional CSS classes to control size, shape, and other styles.
...props
React.ComponentProps<'div'>
All standard HTML div element props are supported.

Accessibility

The Skeleton component should be used for visual feedback only. Ensure you:
  • Remove skeletons and replace with actual content once loaded
  • Use appropriate ARIA live regions if needed for announcing content changes
  • Consider adding aria-busy="true" to parent containers while loading

Animation Performance

The shimmer and gradient variants require custom CSS animations. Make sure you’ve added the keyframe definitions to your global CSS file as shown in the installation steps.

Build docs developers (and LLMs) love