UI Components
Skeleton
A loading placeholder that mimics content layout using animated pulse โ pairs naturally with React 19 Suspense
Quick Preview
Installation
// Copy the Skeleton component fromsrc/components/ui/Skeleton.tsx
Usage
import { Skeleton } from '@/components/ui/Skeleton'// Use inside a Suspense boundary (React 19)export default function PostsFeed() {return (<Suspense fallback={<PostsSkeleton />}><Posts /></Suspense>)}function PostsSkeleton() {return (<div className="space-y-4">{[...Array(3)].map((_, i) => (<Skeleton key={i} variant="card" />))}</div>)}
Examples
All Variants
line
circle
card
block
Blog Card Loading State
Prompt Preview
Copy a prompt that recreates this UI
Paste this into your AI coding assistant to generate code that closely matches the reference, including color, size, shape, typography, spacing, and polish.
Copy-ready AI prompt
Starts from the current visual reference and project constraints.
Tweak only product-specific copy or data after the first generation pass.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
variant | "line" | "circle" | "card" | "block" | "line" | Shape preset for the skeleton |
width | string | - | CSS width (e.g. "200px", "50%") |
height | string | - | CSS height (e.g. "100px") |
lines | number | 1 | Number of lines (for variant="line" only) |
className | string | - | Additional CSS classes |
Features
- โ4 variants: line, circle, card, block
- โanimate-pulse CSS animation
- โMulti-line mode with natural last-line shortening
- โServer Component (no state needed)
- โaria-hidden for accessibility
- โPairs with React 19 Suspense boundaries