GPU-accelerated shimmer placeholder primitives with zero-layout-shift sizing and optional View Transitions API wipe reveals.
Made by AxylInstallation
File Structure
Overview
skeleton-shimmer provides two flexible, GPU-accelerated primitives:
SkeletonShimmer: A standalone shimmer block for fixed or fluid layout placeholders (avatars, image banners, simple text bars).SkeletonOverlay: A zero-layout-shift wrapper that sizes itself using invisible children (visibility: hidden). This eliminates Cumulative Layout Shift (CLS) by matching the exact line heights, margins, and typography of the incoming content.
Customizing colors
The shimmer surface reads two CSS variables: --sk-shimmer-from (block fill) and --sk-shimmer-to (moving highlight). Both default to mixes of your app's --muted / --foreground tokens, so the sweep stays visible in light and dark themes. Override either to retint:
Usage
Basic Shimmer Blocks
Use SkeletonShimmer directly for simple placeholder shapes:
Zero-Layout-Shift Pattern (SkeletonOverlay)
Instead of guessing widths and heights, wrap your actual content structure in SkeletonOverlay. The inner elements determine the exact dimensions while remaining hidden:
Native View Transitions Wipe Reveal
Pair SkeletonShimmer and SkeletonOverlay with the browser's View Transitions API for a right-to-left mask wipe transition:
Props
SkeletonShimmer
| Prop | Type | Default |
|---|---|---|
duration? | number | 1.5 |
borderRadius? | number | string | - |
animate? | boolean | true |
className? | string | - |
ref? | Ref<HTMLDivElement> | - |
SkeletonOverlay
| Prop | Type | Default |
|---|---|---|
children? | ReactNode | - |
duration? | number | 1.5 |
borderRadius? | number | string | "6px" |
animate? | boolean | true |
className? | string | - |
ref? | Ref<HTMLDivElement> | - |
Accessibility
All primitives respect prefers-reduced-motion: reduce via useReducedMotion() from motion/react. When reduced motion is requested, the continuous shimmer animation is disabled while still rendering the styled placeholder surface, and view transitions degrade gracefully to an instantaneous swap.
Credits
Inspired by motion.dev skeleton-shimmer. Reimplemented for Motion and React.
Built by Axyl. A motion-first component registry for React.
Last updated: 8/17/2026