Skeleton Loader, animated React component
A free React skeleton loader that behaves. One highlight sweeps across the whole layout as a single wave instead of every block shimmering alone, the real content blurs in when it arrives, and screen readers hear Loading and then Loaded through a polite live region with aria-busy on the wrapper. Build placeholders from Skeleton, SkeletonText and SkeletonAvatar.
- Free
- Loaders
- Glow
Like Skeleton Loader? 287 more are in Pro.
Pro unlocks all 287 Pro components, every template and block, and everything we release next. Skeleton Loader stays free.
Set it up, copy the code
Choose values for the main props and the JSX on the right updates to match.
True while the content is on its way. Leave it out and the component runs a demo with a button to flip it.
Announced to screen readers while loading.
Announced when the content has arrived.
Sweep a highlight across every placeholder. Off under reduced motion.
Colours for a light or a dark page.
In the demo, flips between loading and content until the visitor touches it. Never runs under reduced motion.
Your JSX
<SkeletonLoader
isLoading={false}
label="Loading"
loadedLabel="Loaded"
shimmer={true}
tone="light"
autoplay={false}
/>Props
| Prop | Type | Default | What it does |
|---|---|---|---|
| isLoading | boolean | — | True while the content is on its way. Leave it out and the component runs a demo with a button to flip it. |
| skeleton | ReactNode | — | The placeholder, built from Skeleton, SkeletonText and SkeletonAvatar. |
| children | ReactNode | — | The real content. It blurs in when isLoading turns false. |
| label | string | "Loading" | Announced to screen readers while loading. |
| loadedLabel | string | "Loaded" | Announced when the content has arrived. |
| shimmer | boolean | true | Sweep a highlight across every placeholder. Off under reduced motion. |
| tone | "light" | "dark" | "light" | Colours for a light or a dark page. |
| autoplay | boolean | false | In the demo, flips between loading and content until the visitor touches it. Never runs under reduced motion. |
| className | string | "" | Extra classes for the outer element. |
Add it to your project
- 1
Set up your project once
You need a Next.js project with Tailwind CSS and the
@/import alias. In its root folder, run this once. It createscomponents.jsonand thecn()helper insrc/lib/utils.ts:npx shadcn@latest init -d
Starting from nothing? The Quick Start walks through the whole thing.
- 2
Connect the registry
Run this once per project. It writes the Nexus UI entry into
components.jsonfor you:npx shadcn@latest registry add "@nexus-labs=https://www.nexus-ui.com/api/registry/{name}"Type it exactly as shown.
{name}is filled in by the CLI with the component you ask for, so you never replace it.
- 3
Add the component
Run this from your project root. It adds the component, the helpers it imports and its npm packages.
npx shadcn@latest add @nexus-labs/skeleton-loader
- 4
Check what was added
With a project made as in the Quick Start (a
src/folder), these files land in it:components/skeleton-loader/index.tsskeleton-loader.tsx - 5
Copying by hand? Skip the registry
Instead of steps 2 and 3 you can copy the files yourself, with no registry and no API key. Step 1 still applies, so that
cn()exists. Install the packages:npm install framer-motion
Then show the source and create each file at the path it gives:
- 6
Use it in a page
Installing only adds the files. Import the component in a page and render it. The Usage tab on the preview shows a fuller example with props:
// src/app/page.tsx import { SkeletonLoader, Skeleton, SkeletonAvatar, SkeletonText } from "@/components/skeleton-loader"; export default function Page() { return ( <main> <SkeletonLoader /> </main> ); }
Like Skeleton Loader? 287 more are in Pro.
Pro unlocks all 287 Pro components, every template and block, and everything we release next. Skeleton Loader stays free.
Skeleton Loader questions
How do I install the skeleton loader?
Run `npx shadcn@latest add @nexus-labs/skeleton-loader`. It adds the component and installs framer-motion.
How do I use it with my own data?
Wrap your content in `SkeletonLoader`, pass `isLoading` from your fetch state and build the placeholder with `Skeleton`, `SkeletonText` and `SkeletonAvatar`. When `isLoading` turns false the content blurs in.
What does aria-busy do here?
The wrapper sets `aria-busy` while loading, and a polite live region says "Loading" and then "Loaded". You can change both phrases with `label` and `loadedLabel`. The placeholder blocks are hidden from screen readers.
Why does the shimmer look like one wave?
All placeholders share one sweep and each block shows its own slice of it, so the highlight crosses the whole layout together instead of every block pulsing alone.
Does it respect reduced motion?
Yes. The sweep is turned off, the content appears without the blur, and the placeholders stay as plain grey blocks.