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

Layered Stack

Stack of cards with depth — back cards are visible offset behind the front card. Hover lifts the top card with a spring.

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.
Layered StackStack of cards with depth — back cards are visible offset behind the front card. Hover lifts the top card with a spring.
Installnpm install framer-motion

Props

PropTypeDefaultDescription
countnumber3Number of stacked cards
colorsstring[]Background color per card (front to back)