Depth Card
Perspective depth effect that responds to mouse movement
Customize
Tweak the props liveDimensions
3D Effects
Animation
Props
| Name | Type | Default | Description |
|---|---|---|---|
image | string | undefined | Background image URL for the card (optional if using layers) |
title | string | "" | Card title |
description | string | undefined | Card description/content |
width | number | 240 | Width of the card in pixels |
height | number | 320 | Height of the card in pixels |
maxRotation | number | 20 | Maximum rotation angle in degrees |
maxTranslation | number | 20 | Maximum translation for parallax effect in pixels |
borderRadius | string | "10px" | Border radius of the card |
className | string | "" | Additional CSS classes for the wrapper |
contentClassName | string | "" | Additional CSS classes for the card content |
onClick | () => void | undefined | Callback when card is clicked |
href | string | undefined | URL to navigate to when card is clicked |
target | "_blank" | "_self" | "_parent" | "_top" | "_self" | Target for link navigation |
imageAlt | string | undefined | Alt text for the background image |
disableOnMobile | boolean | false | Disable 3D effects on mobile devices |
ariaLabel | string | undefined | ARIA label for accessibility |
layers | Array<{image: string, depth: number}> | undefined | Multiple layers for advanced parallax effect |
staggerDelay | number | 100 | Stagger delay between content elements in ms |
revealAnimation | "slide" | "fade" | "scale" | "none" | "slide" | Content reveal animation type |
respectReducedMotion | boolean | true | Respect user's reduced motion preference |
spotlight | boolean | true | Enable spotlight effect that follows the cursor |
spotlightColor | string | "rgba(255, 255, 255, 0.5)" | Color of the spotlight effect |
imagestringBackground image URL for the card (optional if using layers)
undefinedtitlestringCard title
""descriptionstringCard description/content
undefinedwidthnumberWidth of the card in pixels
240heightnumberHeight of the card in pixels
320maxRotationnumberMaximum rotation angle in degrees
20maxTranslationnumberMaximum translation for parallax effect in pixels
20borderRadiusstringBorder radius of the card
"10px"classNamestringAdditional CSS classes for the wrapper
""contentClassNamestringAdditional CSS classes for the card content
""onClick() => voidCallback when card is clicked
undefinedhrefstringURL to navigate to when card is clicked
undefinedtarget"_blank" | "_self" | "_parent" | "_top"Target for link navigation
"_self"imageAltstringAlt text for the background image
undefineddisableOnMobilebooleanDisable 3D effects on mobile devices
falseariaLabelstringARIA label for accessibility
undefinedlayersArray<{image: string, depth: number}>Multiple layers for advanced parallax effect
undefinedstaggerDelaynumberStagger delay between content elements in ms
100revealAnimation"slide" | "fade" | "scale" | "none"Content reveal animation type
"slide"respectReducedMotionbooleanRespect user's reduced motion preference
truespotlightbooleanEnable spotlight effect that follows the cursor
truespotlightColorstringColor of the spotlight effect
"rgba(255, 255, 255, 0.5)"