Components
Skeleton
Pulsing placeholder block that you size to the content it stands in for.
import { Skeleton } from "@openperf/deft";
<Skeleton.Root className="h-4 w-40" />;When to use
| Need | Component |
|---|---|
| Known layout is loading: a line of text, a control, a card | Skeleton |
| Shape of the result is unknown, or one small item is busy | Spinner |
| Table rows | Table.Loading in Table, pending on Data table |
| Chart | Chart.Skeleton in Chart |
| Loading finished and there is nothing to show | Empty |
Sizing
A skeleton has no height of its own: always set one with className. It takes the full width of its container unless you set a width, and its corners are 6px — pass a rounded-* class when the real content has a different shape. The pulse stops for users who ask for reduced motion.
Skeleton is hidden from assistive technology, so mark the loading container with aria-busy.
API
Skeleton.Root declares no props of its own; className sets its size and shape.