Skip to content

Skeleton

Get Ritla UI

Shows the shape of content while it loads, so the page doesn't jump when the real content arrives.

Ritla scan of this preview: 41 of 41 checks3 breakpointsScanned

Open in Figma

Preview

Mirrored is the same English content laid out right to left: it separates a mirroring bug from a translation one.

PreviewCode
EnglishMirroredArabic
LTR →

Installation

  1. Add the component

    npx ritla add skeleton

    Also works with shadcn: npx shadcn@latest add @ritla/skeleton

  2. Or copy by hand

    Installing by hand copies the component's source into your project. The source comes with a Ritla UI license, so the CLI is the short way to the same files.

Usage

skeleton.tsx
import { Skeleton, SkeletonRegion } from "@/components/ui/skeleton";<SkeletonRegion loading={isLoading}>  {isLoading ? <Skeleton className="h-space-12 w-full" /> : <Contacts />}</SkeletonRegion>

Examples

Pulse, then the content

animation="pulse" fades the shape in place, with no direction, instead of the default wave. When the content arrives, the region stops being aria-busy and the layout doesn't jump.

EnglishMirroredArabic
LTR →

API reference

Skeleton

PropTypeDefaultDescription
animation"wave" | "pulse" | "none""wave"Figma's Animation. The wave is a band half the shape's width, sweeping in the reading direction.
classNamestringNoneSize and shape: h-space-12 w-full for a line, size-space-40 rounded-full for an avatar.

SkeletonRegion

PropTypeDefaultDescription
loadingbooleantruearia-busy and the hidden label while loading.
labelReactNode“Loading…”What's read while loading.

Accessibility

ARIA

  • The region is aria-busy="true" while loading, with a hidden label; the shapes are hidden from screen readers.
  • The animation stops when reduced motion is on.
  • Don't keep skeletons when loading fails; show an error.

Arabic and RTL notes

Mirrors

  • Shapes follow the content's layout: the circle at the inline start (the right).
  • The wave runs from the inline start to the end: right to left in Arabic.

Does not mirror

  • The pulse has no direction.
Numerals
No numbers.
Arabic typography
Size skeleton lines close to the taller Arabic line height.

Checks it passes

The Ritla checks this component satisfies by construction. Used as documented, it does not bring these defects onto your page.

  • R042Clipped text: content wider than its box with overflow hidden and no ellipsis
  • R043Fixed-pixel-width container whose Arabic text exceeds the space
  • R050Arabic text falling back past the declared font family (measured, declared, or a webfont that failed to load)
  • R051letter-spacing applied to Arabic text (breaks the connected script)