Reveal Card stacks several images on top of each other and fans them out in 3D when the card is hovered, with each layer offset along its own rotation and translate. Layer count, spread angle, and animation timing are props. Built with Framer Motion and Tailwind CSS. Suits portfolio pieces, app feature highlights, and gallery cards where one image is not enough to tell the story.
Installation
Usage
import { RevealCard } from "@/components/ui/reveal-card";export default function BasicUsage() {
return (
<RevealCard
coverImage="/path/to/cover.jpg"
titleImage="/path/to/title.png"
characterImage="/path/to/character.png"
width={266}
height={400}
/>
);
}export function CustomizedCard() {
return (
<div className="flex flex-col items-center py-12">
<div className="relative group">
<div className="absolute -inset-1 bg-gradient-to-r from-purple-600 to-blue-400 rounded-lg blur opacity-25 group-hover:opacity-75 transition duration-1000 group-hover:duration-200"></div>
<RevealCard
coverImage="/path/to/cover.jpg"
titleImage="/path/to/title.png"
characterImage="/path/to/character.png"
width={300}
height={450}
hoverRotation={30}
titleTranslateY={-60}
characterTranslateY={-40}
characterTranslateZ={120}
animation={{
duration: 600,
delay: 100,
}}
alt={{
cover: "Movie Poster",
title: "Movie Logo",
character: "Main Character",
}}
threshold={0.4}
priority={true}
/>
</div>
</div>
);
}Props
Reveal Card
| Prop | Type | Default | Description |
|---|---|---|---|
coverImage | string | Required | URL for the cover image. |
titleImage | string | Required | URL for the title image. |
characterImage | string | Required | URL for the character image. |
width | number | 266 | Width of the card in pixels. |
height | number | 400 | Height of the card in pixels. |
hoverRotation | number | 25 | Rotation angle on hover. |
titleTranslateY | number | -50 | Y-axis translation for title image on hover. |
titleTranslateZ | number | 100 | Z-axis translation for title image on hover. |
characterTranslateY | number | -15 | Y-axis translation for character image on hover. |
characterTranslateZ | number | 100 | Z-axis translation for character image on hover. |
alt | { cover?: string; title?: string; character?: string } | { cover: "Cover Image", title: "Title", character: "Character" } | Alternate text for the images. |
animation | { duration?: number; delay?: number } | { duration: 500, delay: 0 } | Animation duration and delay in milliseconds. |
priority | boolean | false | If true, images are prioritized for loading (eager loading). |
threshold | number | 0.3 | The threshold for triggering the animation (0-1). |
className | string | "" | Additional CSS classes for the card. |



