Skeleton
Skeleton example: a loading placeholder, a rounded muted block with a pulse animation. Size and shape it with classes to stand in for text lines, avatars or cards while content loads.
pnpm dlx shadcn add @01orbital/skeletonimport { cn } from "cn"
function Skeleton({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
data-slot="skeleton"
className={cn("animate-pulse rounded-2xl bg-muted", className)}
{...props}
/>
)
}
export { Skeleton }
import { Skeleton } from "@/components/ui/skeleton"
/** Skeleton of an image and two lines of text. */
export default function SkeletonDemo() {
return (
<div className="flex w-full max-w-sm flex-col gap-4">
<Skeleton className="h-40 w-full rounded-sm" />
<div className="flex flex-col gap-2">
<Skeleton className="h-4 w-2/3" />
<Skeleton className="h-4 w-1/3" />
</div>
</div>
)
}
Skeleton components
The library's own skeleton components, each installed on its own.
color-field-skeleton
Dependencies
npm: cn. The CLI installs them for you.
No other registry pieces.