Skeleton

A placeholder that holds the shape of content while it loads, so the layout does not jump when data arrives. It shimmers every 1.4s and stays static under reduced motion.

StableSource

Import

tsx
import { Skeleton } from "@merid/react";

Examples

Text block

Without sizing props a skeleton is full width and 1em tall — one line of the surrounding text. Shorten the last line so the block reads as a paragraph.

Shapes

Numbers are pixels, strings are any CSS length. circle rounds fully; set equal width and height.

API reference

Renders an aria-hidden span; forwards its ref. style is merged after the sizing props, so it can override them.

PropTypeDefaultDescription
widthnumber | string"100%"CSS width; a number is px.
heightnumber | string"1em"CSS height; a number is px.
circlebooleanfalseRenders a circle. Set width and height equal.

Styling

HookValues
.mrd-skeletonRoot <span>
data-shaperect · circle

Skeleton has no component variables. The shimmer runs from --mrd-tray to --mrd-tray-2 — the one gradient Merid allows.

Accessibility

  • Every skeleton is aria-hidden; it says nothing to assistive tech on its own.
  • Put aria-busy="true" on the region that is loading, and remove it when content arrives. For a spoken cue, add a visually hidden “Loading…” status.

Guidelines

Do

Mirror the real layout closely — same avatar size, same number of lines — so nothing shifts when content loads.

Avoid

Show skeletons for content that loads in under ~300ms, or for errors and empty results.

  • Spinner — for actions rather than content.
  • EmptyState — what to show once loading finds nothing.