Stack Cards

NewPremium

Cards that stack on scroll with sticky positioning and cascade effect. Each card slides into view and compresses previous ones.

cardsscrollstacksticky

Installation

Terminalbash
npx motioncraft add stack-cards

Usage

stack-cards.tsxtsx
import { StackCards } from "@/components/cards/stack-cards";

<StackCards cards={[
  { id: 1, content: <div>Card 1</div> },
  { id: 2, content: <div>Card 2</div> },
  { id: 3, content: <div>Card 3</div> },
]} />

Props

PropTypeDefaultDescription
cards*StackCard[]Array of card objects with id and content
offsetnumber30Vertical offset between stacked cards
classNamestringContainer CSS classes
cardClassNamestringIndividual card CSS classes

Related Components