Components

Skeleton

The shadcn/ui Skeleton with a soft shimmer sweep tuned for dark UIs and a static fallback for reduced motion — plus React skeleton loader blocks: ready-made text, avatar, card and table placeholders with a wave-like shimmer, and a content loader that crossfades from skeleton to content while animating its height.

  • Drop-in shadcn API
  • Server Component
  • CSS shimmer
  • prefers-reduced-motion

Comments

Loading comments

Installation

$ npx shadcn@latest add https://duskui.com/r/skeleton.json

Replaces components/ui/skeleton.tsx with the same Skeleton export, so the Sidebar's menu skeleton and your existing placeholders keep working. The shimmer is pure CSS (tw-animate-css keyframes, included with shadcn/ui): no JavaScript, works in Server Components and renders the same on server and client.

Usage

profile-skeleton.tsx
import { Skeleton } from "@/components/ui/skeleton"

export function ProfileSkeleton() {
  return (
    <div className="flex items-center gap-4" role="status">
      <span className="sr-only">Loading profile</span>
      <Skeleton className="size-12 rounded-full" />
      <div className="grid gap-2">
        <Skeleton className="h-4 w-48" />
        <Skeleton className="h-4 w-32" />
      </div>
    </div>
  )
}

Examples

Default

Size and shape each block with classes, exactly like shadcn/ui. A faint light sweeps across every block instead of the whole thing pulsing.

Loading profile

Animation

animation picks "shimmer" (default), shadcn's "pulse", or "none". With prefers-reduced-motion, all three are static.

shimmer (default)
pulse
none

Blocks

Ready-made variations composed from the base component with Motion. Each installs on its own and pulls in its dependencies automatically.

Skeleton Presets

SkeletonText, SkeletonAvatarRow, SkeletonCard and SkeletonTable: common layouts in one line. Line widths follow a fixed rhythm (never random, so hydration is safe) and each block's shimmer starts a beat after the previous one, so the light rolls through the layout as a wave. Server Components, no Motion needed.

$ npx shadcn@latest add https://duskui.com/r/skeleton-presets.json
PropTypeDefaultDescription
labelstring—All presets. Announce it as a polite role="status" region. Hidden from screen readers when omitted.
linesnumber3 (Text) / 2 (Card)SkeletonText, SkeletonCard: number of text lines.
lastLineClassName / lineClassNamestring"w-3/5"SkeletonText: width of the last line / classes for every line.
avatarClassName / square / actionstring / boolean / boolean"size-10" / false / falseSkeletonAvatarRow: avatar size, rounded-square avatar, trailing button.
media / footerbooleantrueSkeletonCard: image area and footer row.
rows / columns / headernumber / number / boolean5 / 4 / trueSkeletonTable: body rows, columns and header row.

Content Loader

Swaps a skeleton for the real content. The two crossfade while the wrapper's height springs from one to the other, so whatever sits below glides instead of jumping. With stagger, the content's children rise in one after another. The region is aria-busy while loading and announces loadingLabel. Press Reload.

Comments

Loading comments
$ npx shadcn@latest add https://duskui.com/r/content-loader.json
PropTypeDefaultDescription
loadingboolean—Show the skeleton instead of the children. Required.
skeletonReactNode—The placeholder, shaped like the content. Required.
childrenReactNode—The loaded content.
staggerbooleanfalseFade the children in one after another.
contentClassNamestring—Classes for the element wrapping the children, e.g. "grid gap-4".
loadingLabel / loadedLabelstring"Loading" / ""Screen-reader announcements.

API Reference

Skeleton renders a div and forwards all its props. Size and shape it with classes.

PropTypeDefaultDescription
animation"shimmer" | "pulse" | "none""shimmer"The loading effect. Static under reduced motion.
classNamestring—Size and shape, e.g. h-4 w-48 or size-10 rounded-full.

Accessibility

  • Skeleton blocks are decorative. Mark the region you are loading with aria-busy or a role="status" with a visually hidden label (Content Loader and the presets' label do this for you).
  • Shape placeholders like the real content so the page doesn't shift when it arrives; Content Loader animates any remaining height difference.
  • Under prefers-reduced-motion the shimmer and pulse stop entirely, and Content Loader snaps its height and only fades.