Skip to content
Pixelbits
Docs / Skeleton
Data display

Skeleton

A placeholder while content loads: a fine pixel texture with a soft light gliding across it. CSS only; the glide is a GPU transform that starts mid-sweep, so it never looks frozen. Hidden from screen readers; announce loading elsewhere (for example aria-busy on the region).

Installation

npm: import
import { Skeleton } from "pixelbits/skeleton";
shadcn: copy the source
npx shadcn add https://pixelbits.ali-moradi-develop.com/r/skeleton.json

API

<Skeleton>

A placeholder while content loads: a fine pixel texture with a soft light gliding across it. CSS only; the glide is a GPU transform that starts mid-sweep, so it never looks frozen. Hidden from screen readers; announce loading elsewhere (for example aria-busy on the region).

Example
<div aria-busy="true" className="flex gap-3">
  <Skeleton shape="square" />
  <div className="grid flex-1 gap-2"><Skeleton shape="text" className="w-2/3" /><Skeleton shape="text" /></div>
</div>
PropTypeDefaultDescription
shape"text" | "block" | "square""block"

Shape preset. "text" is a line at the current font size, "block" fills the size you give it (use classes like h-24 w-full), "square" is an avatar-sized square.

Also accepts every prop of HTMLAttributes<HTMLDivElement>.