React Skeleton Loader
A glass React skeleton loader that holds the exact layout while content loads, so nothing jumps when it arrives.
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/skeleton.jsonSkeletonSkeletonCardSkeletonListSkeletonRectSkeletonText- +6 more
- +3 more
Presets
SkeletonCard and SkeletonList match a real card and list line for line: text skeletons use the same line boxes as the text (20px for 14px text), so nothing jumps when the content arrives. Each preset is one named loading region, never one label per line.
import { SkeletonCard, SkeletonList } from "@/components/sheenui/skeleton/skeleton";
// Package build (after the first npm release, or a packed tarball): import { SkeletonCard, SkeletonList } from "@sheenui/theme";
export function Example({ loading }: { loading: boolean }) {
return (
<>
{loading ? <SkeletonCard labels={{ loading: "Loading article" }} /> : <article>Your article card</article>}
{loading ? <SkeletonList rows={4} labels={{ loading: "Loading activity" }} /> : <ul>Your activity list</ul>}
</>
);
}Files to copy
3 folders · 1 file · 2 packages
- From
theme/src/ components/skeleton/lib/cn.tsstyles/
- shadcn CLI
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/skeleton.jsonRegistry item: skeleton. The styles need the Tailwind v4 glass UI setup.- Packages
pnpm add clsx tailwind-merge
Building blocks
Compose your own from Skeleton (rect, text, pill, circle), SkeletonText, SkeletonCircle and SkeletonRect. Wrap them in SkeletonGroup: it names the loading region once, and one beam of light crosses the whole group, every shape in step wherever it sits.
import { Skeleton, SkeletonCircle, SkeletonGroup, SkeletonRect, SkeletonText } from "@/components/sheenui/skeleton/skeleton";
// Package build (after the first npm release, or a packed tarball): import { Skeleton, SkeletonCircle, SkeletonGroup, SkeletonRect, SkeletonText } from "@sheenui/theme";
export function Example() {
return (
<SkeletonGroup labels={{ loading: "Loading profile" }} className="glass-2 rounded-sheen-lg p-6">
<div className="flex items-center gap-4">
<SkeletonCircle size="xl" />
<div className="flex flex-1 flex-col gap-3">
<SkeletonText size="heading" lines={1} />
<Skeleton shape="text" width="40%" />
</div>
<Skeleton shape="pill" width={96} />
</div>
<SkeletonRect height={140} className="mt-6" />
<SkeletonText lines={2} size="sm" className="mt-5" />
</SkeletonGroup>
);
}Skeleton
SkeletonText
SkeletonLabels keys and English defaults (1)
SkeletonCard / SkeletonList
SkeletonGroup
SkeletonCircle props
SkeletonRect props
Keyboard
Accessibility
- Shapes are aria-hidden. Wrap a loading region in SkeletonGroup, or give a preset its own label, so screen readers hear one polite "Loading…" instead of nothing.
- Remove the skeleton (and the status) as soon as content arrives so the real content is announced in its place.
- The live demos on this page pass role="none": a skeleton that is already on screen when the page loads should not be announced. Keep the status role for a skeleton that appears after a user action.
- One shared shimmer beam; it does not run under reduced motion.
All exports on this page
Skeleton— Skeleton: one placeholder shape that holds the layout while content loads.SkeletonCard— A content card preset: media, author row, text and actions, in a SkeletonGroup.SkeletonCircle— An avatar or icon placeholder: a Skeleton circle.SkeletonGroup— Wraps skeleton shapes: a named loading region (role="status" with a visually hidden label) and the box the shimmer sweeps across in one beam.SkeletonList— Rows of a list, inbox or table: avatar, two lines, a trailing pill, in a SkeletonGroup.SkeletonRect— A box: media, a chart, a thumbnail.SkeletonText— Lines of text.defaultSkeletonLabels— English defaults of SkeletonLabels.
When to use Skeleton
- Use SkeletonCard as a skeleton loading state while a product or article card loads, so the 16:9 media block, avatar, text lines and button pills occupy the same space as the real card and nothing jumps.
- Use SkeletonList for an inbox, a user table or a settings list, where each row has an avatar, two text lines and a trailing pill, and rows count is set to match the page size.
- Compose your own layout from Skeleton shapes inside SkeletonGroup for a dashboard widget, so one beam of light crosses every shape in step and the region is named once.
- Skip it for tiny waits or actions that start from a click; Spinner suits a button or inline wait, and Empty state is the right component once loading has finished with no data.
- Pair it with GlassCard for the final content, Avatar for the loaded profile, and a persistent status region if you want a reliable spoken Loaded message.
Frequently asked questions
Related pages
67 components pages in all: browse them on All components.
By Lokendra Singh Rathore (GitHub, opens in a new tab). Published , updated .