Skip to content
GitHub (opens in a new tab)

Skeleton

Gray placeholder shapes that keep the page's layout while content loads.

stableAtomcontracts/skeleton.json

Preview

Skeleton

Gray placeholder shapes in the layout of content that is still loading. Not ShimmerText. Not Spinner. Not Progress.

Master

Three shimmering text lines at md, still loading. Variants shows the other shapes and layouts.

Loading

Usage

Wrap the real content and set loading to false when it is ready. Label one Skeleton in a group; give the rest an empty label.

Do's

  • The first load of a table, card, or list: set layout
  • Content with a known layout is loading: a card, a list, a table, a profile
  • Keeping the page from jumping while data arrives

Don'ts

  • A short status line saying work is happening — use ShimmerText
  • A known amount done — use Progress or Meter
  • A short indeterminate wait with no layout to hold — use Spinner
  • Assistant thinking — use ThinkingAnimation
  • The load failed — show Alert or Empty
<Skeleton lines={3}>
  <p>Sprint 24 is on track. Three tasks still need an owner.</p>
</Skeleton>

Gray placeholder shapes in the layout of content that is still loading, like lines of text, an avatar, or an image, or a whole table, card, or list layout, so the page keeps its shape until the data arrives.

When to use

  • The first load of a table, card, or list: set layout
  • Content with a known layout is loading: a card, a list, a table, a profile
  • Keeping the page from jumping while data arrives

When not to use

  • A short status line saying work is happening — use ShimmerText
  • A known amount done — use Progress or Meter
  • A short indeterminate wait with no layout to hold — use Spinner
  • Assistant thinking — use ThinkingAnimation
  • The load failed — show Alert or Empty

What an agent reads

import { Skeleton } from "agentic-ds-kit";
must
  • The shapes are hidden from screen readers; a visually hidden label (Loading) stands in, and the wrapper is aria-busy while loading
  • In a group, label one Skeleton and give the rest an empty label, so the page says Loading once
  • No motion when the person prefers reduced motion: the shapes stay still gray and loaded content appears at once
defaults
  • shape text
  • lines 1
  • size md
  • animation shimmer
  • loading true
  • label Loading
stops if
  • Do not use it for a short status line — use ShimmerText
  • Do not use it when the amount done is known — use Progress or Meter
  • Do not leave it up when the load failed — show Alert or Empty
  • Do not draw loading bars with local gray divs — use Skeleton
  • Do not invent SkeletonText, SkeletonCircle, or Pulse
  • Do not stack local Skeleton rows to fake a table, card, or list — use layout
  • Do not skip prefers-reduced-motion
  • Do not use raw hex or primitive --color-* ramps
  • Do not add layouts beyond table, card, and list

From contracts/skeleton.json: must is the a11y requirements, defaults the prop defaults, stops if the doNot rules where the agent asks instead of inventing a cousin.

Props

NameTypeRequiredDefaultNotes
shapetext | circle | rectNotexttext: rounded lines as tall as the text. circle: an avatar or icon. rect: a block, like an image, chart, or card.
layouttable | card | listNo—A whole loading area in one piece, in place of shape. table: a header row and body rows at the 40px row height. card: an icon tile and title, then text lines (no frame; put it in a Card). list: an Avatar-sized circle and two lines per row.
linesnumberNo1For text, the line count; with more than one, the last line is shorter, like the end of a paragraph. With layout, the row count (table 5, list 3) or the card's text lines (3) by default.
sizesm | md | lgNomdtext: line height like caption, body-sm, or body. circle: space-8, space-10, or space-12, like Avatar.
widthstring | numberNo—Any CSS width, or px. Text and blocks fill the width by default; circles are square.
heightstring | numberNo—For rect. Defaults to calc(space-12 * 2).
animationshimmer | pulse | noneNoshimmershimmer: a band of light moves across, in step on every skeleton. pulse: a slow fade. none: still gray.
loadingbooleanNotrueOff shows children instead.
childrenslotNo—The real content, shown when loading is off. When loading turns off while on screen, it takes the placeholder's place with no wrapper and fades in out of a light blur (table rows fade their cells, so table markup stays valid); content that renders loaded from the start just appears.
labelstringNoLoadingRead by screen readers in place of the shapes. Give one label to a group and an empty label to the rest.
  • Component
    →

    ShimmerText

    Short live status copy (a running step, a loading line) with a highlight that sweeps over the text while the work runs.

  • Component
    →

    Progress

    Task completion as a bar or circle from 0 to 100, or an indeterminate bar when the percent is not known.

  • Component
    →

    Meter

    How far along or how full something is, from 0 to 100, as a bar, a ring, or a half ring, with optional red, amber, and green zones.

  • Component
    →

    Spinner

    Spinning circular loader for short indeterminate waits.