Card Deck Fan

Physics-based card stack that fans out and stacks on scroll.

Main Features of Card Deck Fan

How to Use Card Deck Fan in Next.js

Installation Guide for Card Deck Fan

Props

Customize the component with these props

PropertyTypeDefaultDescription
images
string[][]Array of image URLs
cardCount
number5Number of cards
backgroundColor
stringbg-slate-900Background color of the component
containerHeight
stringh-[150vh]Height of the container
perspective
stringperspective-[1000px]CSS perspective value
cardWidth
stringw-64Width of each card
cardHeight
stringh-96Height of each card
cardBgColor
stringbg-whiteBackground color of cards
cardBorderColor
stringborder-white/20Border color of cards
cardPadding
stringp-2Padding of cards
imageOpacity
number0.8Opacity of images
labelColor
stringtext-whiteColor of card labels
labelSize
stringtext-xsSize of card labels
hintText
stringSCROLL TO STACKHint text displayed
hintColor
stringtext-whiteColor of hint text
hintSize
stringtext-smSize of hint text
fanAngle
number15Fan angle in degrees
fanXOffset
number100X offset for fan effect
scrollOffset
[string, string]["start end", "center center"]Scroll offset configuration
className
stringAdditional CSS classes

When to Use

Ideal for creative portfolios, e-commerce product stacks, and enterprise-ready UIs that need a playful yet organized way to display cards. Use this React component when building 'Our Team' sections or testimonial carousels that require a physical, tactile feel.

Best Practices

Maintain scalable component architecture by using the `fanAngle` prop to ensure cards don't overlap too much or too little. Follow React best practices by providing unique keys for each card in the stack. Optimize for performance by using a reasonable `cardCount` (e.g., 5-8).

Why This Component Matters in Modern UI Development

Physics-based motion is a hallmark of modern frontend development. This production-ready component helps you build an interface that users instinctively want to interact with, adding a layer of polish to your real-world application architecture.

Frequently Asked Questions

QCan I drag the cards manually?

The primary interaction is scroll-based for a consistent narrative, but it can be combined with drag gestures for a more hands-on experience.

QHow do I add more cards?

Simply pass a longer array of image URLs and update the `cardCount` prop to match.

QIs the stacking animation smooth on mobile?

Yes, it uses Framer Motion's hardware-accelerated transforms to ensure 60fps performance on most mobile devices.

Card Deck Fan - React Scroll Reveal Animations | Uilora