Sora UI

Pixelated Image Reveal

An image card that reveals a second image through a randomized pixel grid on hover, powered by Motion. React component.

Made by Axyl

Hover to reveal a second image through a randomized pixel grid transition.

Loading...

Installation

File Structure

pixelated-image-reveal.tsx

Usage

import { PixelatedImageReveal } from '@/components/sora-ui/effects/pixelated-image-reveal';

export default function Page() {
  return (
    <PixelatedImageReveal
      className="mx-auto w-72"
      defaultSrc="/images/default.jpg"
      activeSrc="/images/active.jpg"
      pixelColor="#ff4c24"
      alt="Product preview"
    />
  );
}

Props

PropTypeDefault
defaultSrc?
string
-
activeSrc?
string
-
alt?
string
""
gridSize?
number
7
stepDuration?
number
0.3
pixelColor?
string
"#ff4c24"
aspect?
"square" | "video" | "auto"
"square"
className?
string
-
pixelClassName?
string
-

When to Use

Use PixelatedImageReveal for portfolio project cards, product imagery with a "before/after" story, or interactive gallery thumbnails. The pixel grid reveal adds personality to a static grid and encourages hovering.

It works best when there is clear visual contrast between the default and active image — for example, a monochrome default with a color active, or a portrait with a project screenshot.

Accessibility

Both defaultSrc and activeSrc represent the same content in different visual states. Provide a meaningful alt description of what the image shows. The reveal transition is purely visual; screen readers announce only the alt text. The component responds to tap on touch devices as well as hover on pointer devices. When prefers-reduced-motion: reduce is set, useReducedMotion() skips the staggered pixel reveal and swaps between images directly — no extra configuration needed.

Built by Axyl. A motion-first component registry for React.

Last updated: 7/26/2026