Motion UIComponentsComponent

Skeleton

A shimmer placeholder that handoffs to real content with a mask wipe or staggered reveal.

npx shadcn@latest add @motion/skeleton

API reference

Components

<Skeleton />

A single skeleton placeholder with a compositor-only shimmer sweep.

animate?

boolean = true

Run the shimmer when true; hold a steady block when false. Defaults to true.

className?

string

Merged onto the bone. Size and shape the placeholder here.

style?

CSSProperties

Extra inline styles, merged onto the bone.

children?

ReactNode

Rendered invisibly to size the bone to the real content geometry.

<SkeletonReveal />

Single-card load handoff via a left-to-right skeleton wipe.

loading

boolean

Whether the skeleton is showing (true) or loaded content has taken over (false).

skeleton

ReactNode

The skeleton placeholder, shown while loading.

children

ReactNode

The loaded content, shown once loading is false.

name?

string = "velocity-skeleton-card"

Shared view-transition name for the handoff. Defaults to velocity-skeleton-card.

className?

string

Merged onto the wrapper around the handoff.

<SkeletonResolveList />

Shares one loading flag with nested SkeletonResolveRows. Renders no DOM of its own.

loading

boolean

Whether the feed is still loading. Shared with every nested row.

children

ReactNode

The rows. Rendered as-is so you own the list element.

stagger?

number

Per-row delay step, in seconds. Defaults to the theme's base stagger.

<SkeletonResolveRow />

One row of a staggered skeleton resolve with zero layout shift.

index

number

This row's position, used to stagger its handoff.

content

ReactNode

The real content layer in normal flow.

skeleton

ReactNode

The bones overlay, faded out as the row resolves.

loading?

boolean

Whether the feed is loading. Inherited from SkeletonResolveList when omitted.

stagger?

number

Per-row delay step, in seconds.

className?

string

Merged onto the row wrapper.

Hooks

useSkeletonSweep

Resolves the shimmer gate and cadence for a skeleton bone.

useSkeletonSweep(options: UseSkeletonSweepOptions<T>): SkeletonSweep

ref

RefObject<T | null>

Ref to the element whose viewport presence gates the loop.

active?

boolean = true

Your own gate, e.g. !loaded. Defaults to true.

Returns

shimmering

boolean

True when the shimmer should run.

sweepTransition

SweepTransition

The token-derived infinite tween for the sweep overlay.

useSkeletonResolve

Resolves crossfade timing and animate targets for one staggered skeleton row.

useSkeletonResolve(options: UseSkeletonResolveOptions): SkeletonResolve

index

number

This row's position, used to stagger its handoff.

loading

boolean

Whether the feed is still loading.

stagger?

number

Per-row delay step, in seconds. Defaults to the theme's base stagger.

Returns

loaded

boolean

True once this row has resolved to its loaded content.

motionAllowed

boolean

Whether full motion is allowed.

transition

ReturnType<typeof useMotionUITransition> & { delay: number }

Transition for both layers, carrying the per-row delay.

content

{ opacity: number; transform: string }

animate target for the real-content layer.

skeleton

{ opacity: number }

animate target for the bones overlay.