Stacking Cards
Show a process in sticky cards. As each card slides into place, the previous card tilts back.
- Dependencies
- gsap
- Size
- 320 lines
- Controls
- 10 controls
Installation
CLI · shadcn registry
npx shadcn@latest add https://ui.onycx.dev/r/stacking-cards.json1 · Dependencies
npm install gsap2 · Copy the source
components/onycx/stacking-cards.tsx
Requires React 19 and Tailwind CSS v4. Copy the source from the stacking-cards.tsx tab after tweaking: your values are baked in as the new defaults. Exported image examples use portable sample artwork. Replace it with your own media as needed.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| items | StackingCard[] | — | { label, title, body, detail?, image, imageAlt? } per card. |
| eyebrow / note | string | "05 / A shared journey" / "Good things take a little consideration." | Top row: dotted eyebrow and a muted note. |
| heading / headingAccent | string | — | Uppercase heading lines ("\n" breaks) and a serif last line at 0.78em. |
| intro | string | — | Muted paragraph beside the heading. Empty hides it. |
| top / endOffset | number | 110 / 130 | Sticky offset, and the viewport offset where the next card finishes covering. |
| scaleTo / tilt / scrub | number | 0.965 / -2 / 0.7 | How a covered card recedes and how tightly it follows scroll. |
| background / card / accent | string | "#e3ebee" / "#f8fafb" / "#354b60" | Section, card surface and step number colours. |
| className | string | — | Extra classes on the section. |