Skeleton

Previous

A skeleton component that provides a placeholder preview of your content before the data gets loaded.

Installation

pnpm dlx shadcn@latest add skeleton

Usage

import { Skeleton } from "@/components/ui/skeleton"
<div className="flex items-center space-x-4">
  <Skeleton shape="circle" className="h-12 w-12" />
  <div className="space-y-2">
    <Skeleton className="h-4 w-[250px]" />
    <Skeleton className="h-4 w-[200px]" />
  </div>
</div>

Examples

Card Skeleton

List Skeleton

Shapes

API Reference

Skeleton

PropTypeDefaultDescription
variant"pulse" | "none""pulse"The animation variant of the skeleton.
shape"circle" | "rounded" | "square""rounded"The shape of the skeleton.
classNamestringundefinedAdditional CSS classes to apply to the skeleton.

Examples

The skeleton component supports different shapes and animation variants to match your content:

  • Circle: Perfect for avatars and profile pictures
  • Rounded: Great for cards, buttons, and general content
  • Square: Useful for images and square elements
  • No Animation: Static skeleton without pulse animation