Skeleton
A placeholder block for content that is loading.
import { Skeleton } from '@/design-system';Examples
Shape each block with classes.
Loading customers
import { Skeleton } from '@/design-system';
export default function SkeletonBasic() {
return (
<div className="space-y-2">
<p role="status" className="text-sm text-muted">
Loading customers
</p>
<Skeleton className="h-11" />
<Skeleton className="h-11" />
<Skeleton className="h-11 w-2/3" />
</div>
);
}How it works
- It is hidden from screen readers. Announce the loading in text nearby.
- It pulses, except for people who ask for reduced motion.
Props
Skeleton takes only this prop.
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | — | Sets the size. Without a height the block cannot be seen. |
Tokens
| Token | Default | Sets |
|---|---|---|
--skeleton-radius | 0.375rem | Corner radius |
--skeleton-background | --border | Fill |