Skeleton
Skeleton is a neobrutalist React component from Cruise UI. Pulsing placeholder blocks while content loads, with text, avatar, card and table-row presets. Install it with npx shadcn@latest add @cruiseui/skeleton.
Install
Terminal
npx shadcn@latest add @cruiseui/skeletonFirst time? Installation shows the one-off components.json setup (the @cruiseui registry) and how to turn the theme on.
Example
Corners
Loading orders…
import {
CruiseSkeletonAvatar,
CruiseSkeletonCard,
CruiseSkeletonRegion,
CruiseSkeletonTableRow,
CruiseSkeletonText,
} from "@/components/cruise/skeleton";
export default function SkeletonExample() {
return (
<CruiseSkeletonRegion label="Loading orders…" className="grid gap-6 md:grid-cols-2">
<div className="flex flex-col gap-4">
<div className="flex items-center gap-3">
<CruiseSkeletonAvatar />
<div className="flex-1">
<CruiseSkeletonText lines={2} />
</div>
</div>
<CruiseSkeletonTableRow />
<CruiseSkeletonTableRow />
</div>
<CruiseSkeletonCard />
</CruiseSkeletonRegion>
);
}
<div aria-busy="true">
<span class="visually-hidden">Loading orders…</span>
<div class="skeleton-stack" aria-hidden="true">
<span class="skeleton skeleton-circle" style="width: 40px; height: 40px"></span>
<span class="skeleton skeleton-line"></span>
<span class="skeleton skeleton-line"></span>
<span class="skeleton skeleton-line" style="width: 60%"></span>
</div>
</div>Needs theme.css. Interactive parts (menus, tabs, drawers) also need the script in the spec for that component.
When to use it
When to use
Content that takes a moment to load and has a known shape.
When not to
Unknown waits or actions (use a Progress spinner). Waits under ~300ms (show nothing).
Props
CruiseSkeleton
| Prop | Type | Default | Description |
|---|---|---|---|
width? | Width<string | number> | — | — |
height? | Height<string | number> | — | — |
circle? | boolean | false | — |
className? | string | — | — |
CruiseSkeletonRegion
| Prop | Type | Default | Description |
|---|---|---|---|
loading? | boolean | true | — |
label? | string | "Loading…" | — |
children | ReactNode | — | — |
className? | string | — | — |
CruiseSkeletonText
| Prop | Type | Default | Description |
|---|---|---|---|
lines? | number | 3 | — |
CruiseSkeletonAvatar
| Prop | Type | Default | Description |
|---|---|---|---|
size? | 32 | 40 | 56 | 40 | — |
CruiseSkeletonTableRow
| Prop | Type | Default | Description |
|---|---|---|---|
cells? | number | 3 | — |
Accessibility
- Skeleton blocks are hidden from screen readers.
- The loading area has aria-busy and a hidden "Loading…".
- Static (no pulse) under reduced motion.