blaze-motion
← All components

Grayscale Reveal

Image

Grayscale → color image reveal — grayscale(1) fades to grayscale(0) alongside opacity.

on scroll
trigger="inView"
on mount
trigger="mount" delay=0.2

Installation

One command drops the source into your repo — editable, with the provider and motion pulled in automatically.

npx shadcn add https://motion.asmitsah.dev/r/grayscale-reveal.json

Usage

Basic

Wrap an image — opacity and grayscale(1) → grayscale(0) settle together on durations.slow, the first time it's 30% in view.

import { GrayscaleReveal } from "@/components/motion/grayscale-reveal";

<GrayscaleReveal className="overflow-hidden rounded-md">
  <img src="/photo.jpg" alt="" className="h-full w-full object-cover" />
</GrayscaleReveal>

Trigger on mount

Play immediately instead of waiting for scroll — for an above-the-fold hero image.

<GrayscaleReveal trigger="mount">
  <img src="/hero.jpg" alt="" className="h-full w-full object-cover" />
</GrayscaleReveal>

With delay

Offset a grid of images so they colorize in sequence rather than all at once.

<GrayscaleReveal delay={0}>
  <img src="/one.jpg" alt="" />
</GrayscaleReveal>
<GrayscaleReveal delay={0.15}>
  <img src="/two.jpg" alt="" />
</GrayscaleReveal>
<GrayscaleReveal delay={0.3}>
  <img src="/three.jpg" alt="" />
</GrayscaleReveal>

Props

PropTypeDefaultDescription
childrenReactNodeThe image (or any element) that fades from grayscale to color.
trigger"inView" | "mount""inView"Animate on scroll-into-view (once) or immediately on mount.
classNamestringPassed straight through — GrayscaleReveal becomes your layout element.
styleCSSPropertiesInline style passthrough.
delaynumber0Seconds before this instance animates.