Skeleton
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
Preview
Mirrored is the same English content laid out right to left: it separates a mirroring bug from a translation one.
Installation
Add the component
npx ritla add skeletonAlso works with shadcn:
npx shadcn@latest add @ritla/skeletonOr 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
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.
API reference
Skeleton
| Prop | Type | Default | Description |
|---|---|---|---|
animation | "wave" | "pulse" | "none" | "wave" | Figma's Animation. The wave is a band half the shape's width, sweeping in the reading direction. |
className | string | None | Size and shape: h-space-12 w-full for a line, size-space-40 rounded-full for an avatar. |
SkeletonRegion
| Prop | Type | Default | Description |
|---|---|---|---|
loading | boolean | true | aria-busy and the hidden label while loading. |
label | ReactNode | “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.
- Clipped text: content wider than its box with overflow hidden and no ellipsis
- Fixed-pixel-width container whose Arabic text exceeds the space
- Arabic text falling back past the declared font family (measured, declared, or a webfont that failed to load)
- letter-spacing applied to Arabic text (breaks the connected script)