ai-animate

Cards

ScrollStack

Cards that stack on top of each other like a deck, revealing one at a time as you scroll.

Installation

npm install @ai-animate/core

Usage

import { ScrollStack, ScrollStackItem } from '@ai-animate/core'


<ScrollStack autoPlay>

<ScrollStackItem>Step 1</ScrollStackItem>

<ScrollStackItem>Step 2</ScrollStackItem>

</ScrollStack>

Props

childrenReactNodeCard items (ScrollStackItem components) (required)
itemScalenumber0.06Scale reduction per depth level
itemStackDistancenumber8Y offset per depth level in px
autoPlaybooleanfalseAuto-animate on a loop — no scroll required
autoPlaySpeednumber0.55Speed of auto-play in cards per second
scrollProgressnumberundefinedExternal progress control (0–1)
stackHeightnumber200Height of the card stack container in px
onStackComplete() => voidundefinedCalled when all cards have been revealed
classNamestring''className on the outer container