Skip to main content
  1. Docs
  2. Components
  3. Feedback

Skeleton

A placeholder shaped like the content that's loading, so the page doesn't move when it lands.

Import
@qeetrix/react
Status
StableSince 0.0.2
Renders
<span aria-hidden="true">Server-rendered
Tested
WCAG 2.2 AAaxe on every pull request

01

Import

skeleton.tsx
// From the package: a build keeps only what it uses.
import { Skeleton } from "@qeetrix/react";

// Or from its own path.
import { Skeleton } from "@qeetrix/react/skeleton";

02

Props

And every native attribute of the element it renders.

PropTypeDefaultWhat it does
variant"text" | "block" | "circle""text"One line, a card or image, or an avatar.
linesnumber—With text: a paragraph of this many lines, the last one shorter, at the lines' height.
size"sm" | "md" | "lg" | "xl""md"With circle: an Avatar's diameter, 32px by default.
style · className…—Its size: inlineSize, blockSize.

03

Parts

Each part carries a data-slot, for tests and placement.

data-slotElementWhat it is
skeleton<span aria-hidden="true">data-variant; it pulses.
skeleton-lines<span aria-hidden="true">A paragraph's lines.

04

Until it loads

Show the skeleton while there's nothing; never over content that's already there.

profile.tsx
{profile ? <ProfileCard profile={profile} /> : <ProfileSkeleton />}
Next — SkeletonAccessibility