affectUI › Motion › Loaders

Shimmer Loader

Skeleton blocks that share one soft light sweep, plus shimmering text for “Thinking…” states.

Free and open source (MIT). Install: npx shadcn@latest add https://www.affectui.com/r/shimmer-loader.json · Import from @/components/ui/shimmer-loader

When to use

  • Placeholders while cards, lists or profiles load, shaped like the content that will arrive
  • A shimmering status label while an AI answer or a long task is being generated

When not to use

  • Waits under ~300 ms – a flash of skeletons feels slower than showing nothing
  • Progress you can measure; a progress bar tells the user how long is left

Usage

import { Skeleton, ShimmerText } from "@/components/ui/shimmer-loader";

export function PostSkeleton() {
  return (
    <div aria-busy="true" className="flex items-center gap-3">
      <Skeleton circle width={36} />
      <div className="grid gap-2">
        <Skeleton width={120} height={10} />
        <Skeleton width={80} height={8} />
      </div>
    </div>
  );
}

export function Thinking() {
  return <ShimmerText>Generating summary…</ShimmerText>;
}

Props

NameTypeDefaultDescription
Skeleton · widthnumber | string"100%"Width – numbers are px, strings any CSS length
Skeleton · heightnumber | string12Height – numbers are px
Skeleton · radiusnumber | string6Corner radius
Skeleton · circlebooleanfalseRound shape that uses width for both sides, e.g. for avatars
Skeleton · className / stylestring / CSSPropertiesExtra class or inline styles on the block
ShimmerText · childrenReactNodeThe label the highlight runs through
ShimmerText · durationnumber2Seconds for one pass of the highlight
ShimmerText · classNamestringExtra class – font size and weight are inherited

Accessibility

  • Skeletons are aria-hidden – put aria-busy="true" on the container that is loading
  • ShimmerText stays real text, so screen readers read the label normally

Responsive

  • Skeletons fill their container by default; set width for fixed shapes
  • Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"

Requirements

  • React 19

Guides