Reveal Card

Layered image card that fans out and lifts into 3D on hover.

Hover on the card

Cover Image
Character
Title

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

PropTypeDefaultDescription
coverImagestringRequiredURL for the cover image.
titleImagestringRequiredURL for the title image.
characterImagestringRequiredURL for the character image.
widthnumber266Width of the card in pixels.
heightnumber400Height of the card in pixels.
hoverRotationnumber25Rotation angle on hover.
titleTranslateYnumber-50Y-axis translation for title image on hover.
titleTranslateZnumber100Z-axis translation for title image on hover.
characterTranslateYnumber-15Y-axis translation for character image on hover.
characterTranslateZnumber100Z-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.
prioritybooleanfalseIf true, images are prioritized for loading (eager loading).
thresholdnumber0.3The threshold for triggering the animation (0-1).
classNamestring""Additional CSS classes for the card.