Skeleton
Placeholder loading shapes with a shimmer animation — text lines, list rows, table rows, and detail panels.
Default
Skeleton renders a single shimmer placeholder block. Control the shape and size through style or className.
Card Grid
Combine multiple Skeleton blocks to mirror a card-grid loading state. The thumbnail height and text line widths approximate the content shape.
List Rows
SkeletonList renders count placeholder rows with an avatar circle, two text lines, and a badge pill — matching the anatomy of a people-list or activity-feed loading state.
Table Rows
SkeletonTable renders rows × columns cell placeholders for data-table loading states. Column widths vary so the skeleton reads as a real table rather than a uniform grid.
Detail / Profile
SkeletonDetail renders a large avatar block, a heading-height line, and lines body-text placeholders — matching a profile or detail-panel loading state.
Installation
npx visor add skeletonThis copies two files into your project:
components/ui/skeleton/skeleton.tsx— the componentcomponents/ui/skeleton/skeleton.module.css— the styles
Usage
import { Skeleton, SkeletonList, SkeletonTable, SkeletonDetail } from '@/components/ui/skeleton/skeleton';
// Single block
<Skeleton style={{ height: '1rem', width: '12rem' }} />
// List rows
<SkeletonList count={5} />
// Table rows
<SkeletonTable rows={6} columns={3} />
// Detail / profile
<SkeletonDetail lines={4} />Composition Notes
Skeletonfills the exact bounding box of its container — size it withstyleorclassNameso there is no layout reflow when real content replaces it.- Use
aria-hidden="true"on individualSkeletonblocks when a parentrole="status"carries the accessible label.SkeletonList,SkeletonTable, andSkeletonDetailalready includerole="status"andaria-label. - Never render skeletons for a confirmed empty collection — use the
EmptyStatecomponent instead. - Real content should fade in over 200 ms (
transition: opacity 200ms ease-out) to avoid a jarring swap.
API Reference
Skeleton
No props data available for “skeleton”.
The component also accepts all standard <div> HTML attributes.
SkeletonList
| Prop | Type | Default | Description |
|---|---|---|---|
count | number | 3 | Number of placeholder list rows. |
Also accepts all standard <div> HTML attributes.
SkeletonTable
| Prop | Type | Default | Description |
|---|---|---|---|
rows | number | 4 | Number of table rows. |
columns | number | 4 | Number of cells per row. |
Also accepts all standard <div> HTML attributes.
SkeletonDetail
| Prop | Type | Default | Description |
|---|---|---|---|
lines | number | 3 | Number of body text lines below the heading. |
Also accepts all standard <div> HTML attributes.