Skeleton

A placeholder in the shape of content that loads.

Source

Shapes and content

Use this for content that takes long enough to load that users notice. Placeholders match the shape and size of the content. Use the button to switch.

Usage

These are defaults, not laws. Break one when you have a good reason, or when it makes the design more cohesive or more interesting.

  • Wrap the real layout in Skeleton. While it loads, Skeleton hides the content and draws the placeholder in exactly its space, so nothing moves when it loads. Render sample text in place of data that has not arrived.
  • Without children, set lines, width, and height to estimate the size of content you cannot render yet.

API

Props that the library adds. Every part also takes all the Base UI props.

Skeleton

PropTypeDefaultDescription
shape'text' | 'rect' | 'circle''text'The placeholder shape.
widthnumber | string–A width in pixels or a CSS value. Used without children.
heightnumber | string–A height in pixels or a CSS value. Used without children.
linesnumber1The number of text lines. Used without children.
loadingbooleantrueShows placeholders when true. Shows children when false.
childrenReactNode–The content. While loading, it sets the size and shape of the placeholder.
classNamestring–Classes for the placeholder, or for the wrapper around children.