3d Layered Card

Interactive card with stacked 3D layers that expand and tilt toward the pointer on hover.

Logo

Snapchat

REVENUE

The addictive habbit of sending snaps.

4 min
Character
Logo

McDonald's

ONBOARDING

The Psychology Behind McDonald's $2 Meal.

5 min
Character

3D Layered Card is a React component that stacks multiple content layers with spring-based depth, driven by pointer tracking. Each layer tilts, shifts, and scales at a slightly different rate as the cursor moves across the card, and the layers fan out on hover. Built with Framer Motion and Tailwind CSS. Works well for product showcases, feature callouts, and portfolio pieces.

Installation

Usage

import ThreeDLayeredCard from "@/components/ui/3d-layered-card";

Basic Usage

<ThreeDLayeredCard
  logo="/assets/logos/nyx-logo.webp"
  mainImage="/character.png"
  title="Interactive Card"
>
  <p>Hover to see the magic!</p>
</ThreeDLayeredCard>

Custom Styling

<ThreeDLayeredCard
  logo="/assets/logos/nyx-logo.webp"
  mainImage="/character.png"
  title="Custom Card"
  width={320}
  height={{ collapsed: 140, expanded: 350 }}
  logoSize={80}
  backgroundColor="bg-gradient-to-b from-purple-500 to-blue-600"
  textColor="white"
  glowColor="rgba(168, 85, 247, 0.2)"
  glowGradient="#a855f7"
  shineIntensity={0.5}
>
  <div className="space-y-2">
    <h3 className="text-lg font-semibold">Custom Title</h3>
    <p className="text-sm opacity-90">Custom description content</p>
  </div>
</ThreeDLayeredCard>

Props

PropTypeDefaultDescription
logostringRequiredPath to the logo image.
mainImagestringRequiredPath to the main character/image displayed on hover.
titlestringundefinedTitle text displayed in collapsed state.
childrenReact.ReactNodeundefinedContent displayed in expanded state on hover.
classNamestringundefinedAdditional CSS classes to apply to the container.
widthnumber | string288Width of the card in pixels or CSS units.
heightobject{ collapsed: 130, expanded: 300 }Height configuration for collapsed and expanded states.
logoSizenumber64Size of the logo in pixels.
logoPositionobject{ expanded: 15 }Logo position from top when expanded (in pixels).
shineIntensitynumber0.3Intensity of the shine effect (0-1).
backgroundColorstring"bg-gradient-to-b from-[#FF9901] via-[#DF911A] to-[#724f13]"Background gradient classes or CSS.
borderColorstringundefinedBorder color (requires borderWidth).
borderWidthstring"0"Border width CSS value.
textColorstring"white"Text color for title and content.
glowColorstring"rgba(255, 165, 0, 0.1)"Glow color for hover effects.
glowGradientstring"#fde047"Gradient color for the character glow effect.
titlePositionnumber90Fixed title position from top in collapsed state (in pixels).