Skip to content
roguelite labsAnthony Spezzano ↗
motion/animated-stack

Animated Stack

Cards cycle to the front on an auto-loop using AnimatePresence. The front card animates in from above; old front exits downward.

Use and inspectUse this when the motion supports the surrounding content. Connect callbacks and state to your app, keep the reset preview as a local demonstration, and add a reduced-motion fallback for movement or looping. The preview is synthetic; it does not call a backend.Next: inspect the source below and replace the demo inputs with your own data.
Animated StackCards cycle to the front on an auto-loop using AnimatePresence. The front card animates in from above; old front exits downward.
Installnpm install framer-motion

Props

PropTypeDefaultDescription
items{ label: string; color: string }[]3 built-in cardsStack items
intervalnumber2000Cycle interval in ms