Skeleton

A React component in Beamline's Feedback category, in the free sample.

Holds the shape of content while it loads, then crossfades into it, so nothing jumps.

Use it for

  • Reserving layout while content loads so nothing jumps.

Not for

Anatomy

  • root (aria-busy region)
  • avatar circle (optional)
  • text lines (last one shorter)
  • content (children, revealed when loaded)
  • group (SkeletonGroup: many shapes under one visibility and motion check)
  • line (SkeletonLine: one line of text that has not arrived, exactly the surrounding text style's line tall)

Variants

  • shape: lines, avatar + lines, custom (SkeletonBlock pieces), many shapes (SkeletonGroup with `sheen` elements inside)

States

  • loading
  • loaded (crossfade into children)

Keyboard

  • None; the region is aria-busy while loading and announces its label.

Motion

A soft sheen crosses the blocks while loading; it stops entirely under reduced motion. Loaded content fades in over --pui-duration-standard. When the placeholder gives way to the content (or back) and the two differ in height, the box eases between them over --pui-duration-standard (a swap mid-way starts from where it is; off screen and under reduced motion it changes at once), so what sits below glides.

Props

PropTypeDefaultDescription
loadingbooleantrueWith children: the placeholder shows while true, the children after.
linesnumber3Text lines in the placeholder; the last is shorter.
avatarboolean—A round avatar before the lines.
labelstring"Loading content"Announced to assistive tech while loading.
childrenReactNode—The real content.
classNamesSkeletonClassNames—Classes for the named visual parts; no part overrides by default.
style / refCSSProperties / native Ref—style: Inline styles on the documented visual root; no inline overrides by default. ref: Receives the documented root element; no ref by default.
classNamestring—Classes on the documented visual root; no override by default.
refRef<HTMLDivElement>—Receives the documented root element; no ref by default.
styleCSSProperties—Inline styles on the documented visual root; no inline overrides by default.

Built from

  • SkeletonBlock: one placeholder shape (any width, height, radius) for building the real layout's silhouette.
  • SkeletonGroup: many placeholder shapes (heatmap cells, chart bars, a list's loading rows) under one visibility and motion check; every element with the `sheen` class inside it, at any depth, pauses off screen and stills under reduced motion together. Use it instead of hundreds of SkeletonBlocks, and to keep a loading list's real row structure.
  • SkeletonLine: inside a SkeletonGroup, a placeholder for one line of text; give it the real text's classes and a width, and the loaded line replaces it without a shift.

Used in

Dependencies

motion

Import

import { SkeletonBlock, SkeletonGroup, SkeletonLine, Skeleton } from "@beamline/skeleton";

Get it

Skeleton is part of Beamline UI. Install the parts you need in your React app as compiled packages or editable source. Skeleton is included in the free MIT sample. Get Beamline · Connect your agent

More in Feedback

  • Timer: A duration that counts down (or up) from your clock: Start, Pause, Resume, Reset and the finish reported once; the time left drawn as a bar you drag (or…
  • Notification centre: Updates that wait to be read: a bell with the unread count opens All / Unread, new and earlier groups, and per item mark read or dismiss.
  • Usage meter: An allowance and what fills it: one bar split by source, the room left, a warning near the limit and the overflow in its own red well past a notch at the…
  • Alert: A message that stays until it is dealt with: what happened, what to do, an action; danger and warning are announced; dismissing folds its height away.
  • Cookie consent: Asks once which cookies a visitor allows, with Reject all and Accept all given equal weight; Customise grows the notice in place into each category with…
  • Empty state: What a place will hold and the first step to fill it, instead of a blank; a compact size for panels and filtered tables.
  • Spinner: A ring that spins while work runs and closes into a drawn check or cross when it ends.
  • Announcement bar: A banner across the top for news and offers: messages take turns, a countdown ticks, and dismissing folds it away and can remember it.
  • Progress: How much of a known task is done, or a moving bar when the length is unknown, with an optional label and value.

Part of Beamline UI: polished, editable React components and complete screens for custom applications. Build your own style from any look; tokens, fonts, radii, motion; not only colours.