Skip to content

Skeleton

⋯

Skeleton is a visual placeholder, not the content itself. Its tone prop maps to the Neutral and Teal tones of the Figma .Skeleton Line.

import { Skeleton } from "@nesra/ui/skeleton";
export function LoadingTitle() {
return <Skeleton className="w-48" />;
}

Skeleton is also exported from @nesra/ui.

Use width classes for lines of different lengths. Widths are explicit and stable, so the loading layout stays predictable.

Loading article excerpt

Use height classes to match the line height of the content that will replace each placeholder. The default height is 16px.

Loading text

Use rounded-full for a circular avatar placeholder or a rounding class for a rectangular surface.

Loading content

Compose placeholders to approximate the space the content will occupy. Replace the entire loading region with real content when it arrives.

Loading profile

Match the eventual card’s image and text areas to limit layout shift when content arrives.

Loading article card

Repeat a small composition for rows while the application loads a list. The row count here is illustrative, not a Skeleton prop.

Loading team members

tone="neutral" uses Foundation/bg-disabled for white surfaces. tone="teal" uses Categorical/Teal/subtle-hover for AI content on a Categorical/Teal/subtle surface. Figma’s .Skeleton Line is 10px high with radius-xs, which the example sets with h-2.5 rounded-nesra-xs.

Loading summaryLoading AI insight

Skeleton uses Foundation/bg-disabled (--nesra-foundation-bg-disabled), which is gray-100 in Light and gray-800 in Dark, so the placeholder follows the page theme through .dark or data-theme="dark". The Teal tone uses Categorical/Teal/subtle-hover, which is teal-100 in Light and teal-900 in Dark.

Skeleton has aria-hidden="true" and does not announce loading by itself. Provide a visible or screen-reader-only loading message in a named status region, as shown above. Set aria-busy on the region while loading and remove it when real content replaces the placeholders. The pulse animation stops when the user prefers reduced motion.

Prop Type Default Description
tone "neutral" | "teal" "neutral" Fill color. teal is for AI loading states on Teal surfaces.
className string — Tailwind classes for width, height, shape, or other visual overrides.

Skeleton forwards other native div props and its ref points to the div. It does not accept children or an aria-hidden override. By default, it is full width, 16px high, and has medium rounding. The neutral background uses bg-nesra-foundation-bg-disabled and the Teal background uses bg-nesra-categorical-teal-subtle-hover from the semantic color roles.