About the shadcn/ui Skeleton Component
The Skeleton component is part of shadcn/ui — a collection of accessible, copy-paste React components built with Radix UI and Tailwind CSS. Install it with `npx shadcn@latest add skeleton` and copy it directly into your project.
Skeleton Component — Frequently Asked Questions
How do I create a card skeleton loader with shadcn?
Replicate your card layout with `<Skeleton>` elements: `<Skeleton className="h-40 w-full mb-4" />` for an image, then rows for title and text.
How do I conditionally show skeleton or real content?
Use a loading state: `{isLoading ? <SkeletonCard /> : <RealCard data={data} />}`. The skeleton should match the exact dimensions of the loaded content.
How do I customize the skeleton animation?
Override the `animate-pulse` class in your CSS or add a custom `shimmer` animation. The `<Skeleton>` component accepts a `className` prop for full customization.