Duolith docs

Skeleton

A placeholder in the shape of content still loading: lines of text, a circle or a block.

Stability: experimental

Props

PropTypeDefaultMeans
shape"line" | "circle" | "block""line"Lines of text, a circle (an avatar), or a block (an image or a card).
linesnumber1For lines: how many; the last of several is shorter.
width"full" | "3/4" | "1/2" | "1/3""full"For lines: how much of the width they take.
size"sm" | "md" | "lg""md"For a circle, 32, 48 or 72 points across; for a block, 96, 160 or 240 points tall.
labelstringAnnounced once, politely, such as "Loading posts". Give it to one skeleton of a screen, not each.

States

StateLooks like
shimmeringA soft highlight sweeps across the raised shape every 1.4 seconds.
reduced motionNo shimmer: a still raised shape.

Accessibility

rolenone of its own; with a label, a status holding the label as visually hidden text
nameThe label prop, when given.
focusNever focusable.
notesThe shimmer stops when the device asks for reduced motion (prefers-reduced-motion).

Theme tokens

color.raised color.surface space.2 radius.sm radius.md radius.full

Example

<Skeleton shape="circle" label="Loading the profile" /><Skeleton lines={3} />