Micro-interactions

Pixel Transition

Reveal a second layer through a random pixelated dissolve on hover.

Adapted from React Bits

Install

bun add gsap clsx tailwind-merge

Then copy 2 files into your project:

  • components/registry/pixel-transition/pixel-transition.tsx
  • lib/utils.ts

Props

PropTypeDefaultDescription
gridSizenumber7Pixel grid resolution.
pixelColorstring (hex)"#a855f7"Color of the dissolve pixels.
animationStepDurationnumber0.3Duration of the dissolve.
oncebooleanfalsePlay only once instead of on every hover.

What It Demonstrates

Reveal
Content is uncovered gradually, often by animating a clip-path or mask.
Stepped animation
An animation that is divided into discrete steps, like a countdown timer.
Hover effect
Visual change when the cursor moves over an element.
Crossfade
One element fades out as another fades in, in the same spot.

Related Components

Appears In