Skeleton
A placeholder UI component that improves perceived performance by mimicking the final layout while content loads dynamically, reducing loading anxiety.
Installation
Install the component via the CLI in one command.
npx shadcn@latest add @intentui/skeleton
Manual installation
Use this approach if you prefer to install and wire up the component yourself instead of using the CLI.
Anatomy
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CardAction } from "@/components/ui/card"
import { Skeleton } from "@/components/ui/skeleton"
<Card className="p-4">
<div className="flex gap-2">
<Skeleton className="size-8" />
<div className="space-y-1">
<Skeleton className="h-4 w-56" />
<Skeleton className="h-4 w-16" />
<Skeleton className="h-4 w-24" />
<Skeleton className="h-4 w-32" />
</div>
</div>
</Card>Examples
Soft
The soft prop makes the skeleton slightly darker. By default, it is set to false.
Shape
Sometimes, you may need a skeleton with a specific shape. For example, if you want all skeletons to be circular, you can simply add rounded-full to the skeleton component. This example demonstrates how to achieve that by styling the skeleton from its parent.
Component API
The Skeleton component displays a placeholder while content loads.
| Prop | Type | Default |
|---|---|---|
className | string | - |
soft | boolean | false |
Intent UI Design
Build modern web apps faster with 1000+ resources across components, blocks, patterns, templates, and starter kits.