Skeleton
Data DisplayLoading placeholder with pulse animation for content that is still loading.
Responsive viewport — resize the window to explore. Direction and density apply only to this preview. Theme applies to the docs too.
"use client";
import { Skeleton } from "@dashboardpack/core/components/ui/skeleton";
export default function SkeletonExample() {
return (
<div
className="w-full max-w-sm space-y-6"
role="status"
aria-label="Loading profile"
>
<div className="flex items-center gap-4">
<Skeleton className="size-12 rounded-full" />
<div className="flex-1 space-y-2">
<Skeleton className="h-4 w-3/4" />
<Skeleton className="h-3 w-1/2" />
</div>
</div>
<Skeleton className="h-32 w-full rounded-xl" />
<div className="space-y-2">
<Skeleton className="h-3 w-full" />
<Skeleton className="h-3 w-4/5" />
</div>
<span className="sr-only">Loading profile, please wait.</span>
</div>
);
}Usage
Match the approximate size and shape of content being loaded. Replace skeletons when data arrives and provide an error state when loading fails.
import { Skeleton } from "@dashboardpack/core/components/ui/skeleton";Available in the included @dashboardpack/core package. Copy the complete example from Source code for all imports and state. Add "use client" when using hooks or event handlers. See installation and theming for project setup.
API reference
Common props and defaults. Slot-specific props are named below; native elements also accept their standard HTML attributes. The component TypeScript definitions are the complete type reference.
| Prop | Type / Default | Description |
|---|---|---|
| className | stringDefault: — | Set the placeholder dimensions and shape. |
| style | CSSPropertiesDefault: — | Use for dynamic measured dimensions. |
| aria-hidden | booleanDefault: — | Hide purely decorative placeholder shapes. |