Skeleton
Loading placeholder shapes with a reduced-motion-safe shimmer.
Primitive · feedback
Install
Section titled “Install”npx shadcn@latest add https://ndigo.dev/r/skeleton.jsonTo use the shorter @ndigo/skeleton form, configure the namespace in components.json.
| Source | Target | Type |
|---|---|---|
registry/ui/skeleton/nd-skeleton.css |
@ui/nd-skeleton/nd-skeleton.css |
registry:file |
Live example
Section titled “Live example”See this component rendered live on the live examples page.
Dependencies
Section titled “Dependencies”None.
Documentation
Section titled “Documentation”Skeletons are markup plus CSS. They mirror the shape of the content that is loading so the page does not jump when it arrives.
<div aria-hidden="true"> <span class="nd-skeleton" data-shape="text" style="inline-size: 60%"></span> <span class="nd-skeleton" data-shape="text" style="inline-size: 40%"></span> <span class="nd-skeleton" data-shape="circle"></span> <span class="nd-skeleton" data-shape="rect"></span></div>Set widths inline or with a local class; the shapes provide the height and radius.
Shapes
Section titled “Shapes”data-shape |
Size |
|---|---|
text (default) |
One line tall, pill radius |
circle |
2.5rem square, fully round |
rect |
6rem tall block |
Accessibility
Section titled “Accessibility”The skeleton is decorative. Wrap it in aria-hidden="true" and announce the
loading state separately, for example with a <p role="status">Loading…</p> or
an aria-busy="true" region. The shimmer is disabled when the visitor prefers
reduced motion.
Styling
Section titled “Styling”Import nd-skeleton.css after the tokens. The base uses the raised surface; the
shimmer overlays a low-opacity text gradient.