Search

Find a component, token or page

Base · Feedback

Skeleton

A pulsing placeholder in the shape of content that is still loading.

HTML / JSPlannedReactStableReact NativeDraftSwift (SwiftUI)PlannedGodotPlannedVueDraftSvelteDraftSolidDraft
Reviewed

Props

tsx
import { Skeleton } from "@/components/ui/skeleton"

<div className="flex items-center gap-3" aria-hidden="true">
  <Skeleton className="size-9 rounded-full" />
  <div className="grid flex-1 gap-2">
    <Skeleton className="h-4 w-1/2" />
    <Skeleton className="h-3 w-3/4" />
  </div>
  <Skeleton className="h-5 w-14 rounded-full" />
</div>

Overview

A skeleton is a muted block that stands in for text, an image or a control while data loads. Arrange several to match the layout that is coming, so the page does not jump when the content arrives.

When to use

  • On first load of a page, card, list or table whose layout is known in advance.
  • When loading usually takes longer than about half a second.

When not to use

  • For an action the user just triggered, such as saving: use a Spinner in the Button.
  • When progress can be measured: use Progress.
  • When the result may be empty or its shape is unknown: use a Spinner, then an Empty state if there is nothing to show.
  • For loads that finish almost instantly, where a flash of placeholders is more distracting than a blank moment.

Anatomy

  1. Block

    A single muted rectangle. Size and corner radius come from utility classes: a line of text, a circle for an avatar, a rectangle for an image.

Props

The contract every language implements. Names follow each language’s conventions (camelCase in React, snake_case in Rust).

PropTypeDefaultDescription
layout"list" | "card" | "text"listPlayground only. The arrangement of blocks to preview; in code you compose it yourself.
rowsnumber3Playground only. How many rows or lines the example repeats.
classNamestring–Sets the size and shape of the block, for example `h-4 w-48` or `size-10 rounded-full`.

States

Loading
Opacity pulses continuously.
Reduced motion
Respect the user's setting by adding motion-reduce:animate-none where pulsing would be a problem.

Accessibility

  • Skeletons carry no meaning for assistive technology. Hide the group with aria-hidden and mark the region being loaded with aria-busy="true".
  • Announce the loaded content, or move focus to it, only when the user is waiting on it.
  • Do not put text inside a skeleton.

Design tokens

Change any of these in Foundations and this component follows, in every language.

Platform notes

HTML / JS
Planned
Not built in HTML / JS yet.
React
Stable
Matches the contract with no platform differences.
React Native
Draft
An Animated View whose opacity pulses on a loop and holds still under reduce motion; size it with width, height and radius. SkeletonGroup draws the list, card and text layouts, pulses its blocks together and marks the region busy.
Swift (SwiftUI)
Planned
Not built in Swift yet.
Godot
Planned
Not built in Godot yet.
Vue
Draft
Usage snippet only; same props and behavior as the React component.
Svelte
Draft
Usage snippet only (Svelte 5); same props and behavior as the React component.
Solid
Draft
Usage snippet only; same props and behavior as the React component.

Related