Skip to content

Skeleton

A placeholder with the shape of the content that is loading. Every skeleton on the page shares one light sweep, like a single light passing over the layout. Presets for text, a profile card, a list and a media grid, and a gate that fades into the real content without moving anything.

On this page
Used for
  • Loading a run list
  • Profile cards
  • Media grids
  • Chat history

Examples

Installation

npx knowns-ui@latest add skeleton
For Claude Code, Cursor or Codex: installs it and wires the props to your own data.

Props

Skeleton: className / style
-
Size and shape, e.g. h-4 w-32 or size-10 rounded-full. Backwards compatible: nothing else is required.
SkeletonText: lines
number
Default3
Lines of text; the last one is shorter.
SkeletonProfile: lines
number
Default3
Avatar, name and handle, then bio lines.
SkeletonList: rows
number
Default4
Rows with a leading tile, two lines and a trailing pill.
SkeletonMediaGrid: items, columns
number, 2 | 3 | 4
Default6, 3
16:9 thumbnails with a caption each.
label (every preset)
string
Default"Loading"
The accessible name of the loading region (role=status).
SkeletonGate: loading, skeleton
boolean, ReactNode
Stacks the skeleton and the content in one cell. When loading turns false the skeleton fades out as the content fades in (220 ms), then leaves the layout.
SkeletonGate: children
ReactNode
The content. Render it while loading too, with empty or placeholder data, so the cell is already its final size. It is inert and hidden from assistive tech until loaded.
Motion
-
One sweep for the whole page: a light band painted fixed to the viewport, so every skeleton shows the part passing behind it, started on the shared document clock so blocks mounted later stay in step. One background-position change per block per frame, no JavaScript per frame. Reduced motion: still blocks and an instant swap. iOS Safari ignores fixed backgrounds: each block sweeps on its own there.

One light, every block

Preview

Loaded crossfade

With Shimmer Text

What it handles

  1. 01Draws a placeholder block you size with classes, such as `h-4 w-32`.
  2. 02Shares one light sweep across every skeleton on the page, so blocks mounted at different moments still sweep in step.
  3. 03Ships four presets: SkeletonText with a shorter last line, SkeletonProfile, SkeletonList with `rows`, and SkeletonMediaGrid with `columns`.
  4. 04Names each preset as a loading region through `label`, which defaults to "Loading".
  5. 05Swaps skeleton and content with SkeletonGate, which stacks both in one grid cell so nothing moves when `loading` turns false.
  6. 06Hides the content from assistive tech and from focus while `loading` is true.

States

First render
The sweep starts on the shared page clock
none
Loading
One light band crosses every skeleton in a loop
none
Gate loading ends
The skeleton fades out as the content fades in
180ms, ease out
Reduced motion
The block stays still with no band
0ms

Works with

When to use

When to use

  • Placeholders that keep the layout while content loads: a block per thing, or a preset shaped like a profile, a list or a media grid.
  • Swapping a skeleton for the real content without a jump: SkeletonGate crossfades in place.

When not to use

Using with AI

Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:

  • Add the Knowns UI Skeleton to my app and wire it to my own data.
  • I need placeholders that keep the layout while content loads: a block per thing, or a preset shaped like a profile, a list or a media grid. Set that up with the Knowns UI Skeleton.
  • Which Skeleton props do I need for a minimal setup? Show me a short example.

With the server connected, your assistant calls get_component({ name: "skeleton" }) and search_docs({ query: "skeleton" }).

Need help?

Stuck on Skeleton, or found something off? We read every message.