Skeleton
FreeA loading placeholder with a moving sheen.
Installation
pnpm dlx shadcn@latest add @viewport/skeleton
First time? Add the @viewport registry to components.json. Setup takes one minute.
Usage
The code behind the preview above.
import { Skeleton } from "@/components/viewport/skeleton";
export default function SkeletonDemo() {
return (
<div aria-busy="true" aria-label="Loading profile" className="w-full max-w-sm rounded-2xl border border-border bg-card p-5">
<div className="flex items-center gap-3">
<Skeleton className="size-11 rounded-full" />
<div className="flex-1 space-y-2">
<Skeleton className="h-3.5 w-2/5" />
<Skeleton className="h-3 w-3/5" />
</div>
</div>
<Skeleton className="mt-5 h-32 w-full rounded-xl" />
<div className="mt-4 space-y-2">
<Skeleton className="h-3 w-full" />
<Skeleton className="h-3 w-4/5" />
</div>
</div>
);
}Accessibility
- Hidden from assistive tech; mark the region with aria-busy.
- The sheen stops under reduced motion.