Card Stack

A stack of cards that stack on top of each other with a satisfying fade animation. Perfect for testimonials, notifications, or flashcards.

Examples

Default

25% off our latest model

Get 25% off usage of our newest reasoning model for the next 30 days. Built for complex tasks, coding, and long-context workflows.

Free observability for 90 days

Monitor every request with traces, latency, token usage, and model performance. No instrumentation fee for your first 90 days.

2M free API tokens

Build and test your next AI feature with 2 million tokens included on every new developer account.

Ship agents for less

Save 30% on agent runs this month. Includes tool calling, web search, structured outputs, and persistent task execution.

Scale without the cold start

Priority inference and dedicated capacity for production workloads. Get predictable latency when your traffic spikes.

Controlled

AC
Alex Chen@alexcodes

Building clean, minimal software for the modern web.

TypeScriptReactNode.js
MT
Maya Torres@mayadev

Full-stack engineer riding the deep end of the stack.

PythonDjangoPostgreSQL
SO
Sam Okafor@sambuilds

Open-source maintainer and systems tinkerer.

RustGoKubernetes
EV
Elena Voss@elenacodes

Crafting premium developer experiences, pixel by pixel.

SwiftSwiftUIFigma
JL
Jordan Lee@jlee.dev

Coffee-fueled backend engineer shipping resilient APIs.

JavaSpringAWS
PN
Priya Nair@priyabuilds

Designing delightful, accessible frontend interfaces.

VueTailwindGraphQL

Installation

npx shadcn@latest add "https://flow-kit-beta.vercel.app/r/card-stack.json"

API Reference

CardStack

PropTypeDefaultDescription
childrenReact.ReactNodeRequiredThe card elements to display in the stack.
classNamestringundefinedAdditional CSS classes for the container.
offsetsCardOffset[][{ scale: 1, y: 0, opacity: 1 }, { scale: 0.95, y: 12, opacity: 1 }, { scale: 0.9, y: 24, opacity: 1 }]Visual offsets for stacked cards (scale, position, opacity).
maxVisibleCardsnumber3Maximum number of cards visible in the stack.
transitionTransition{ type: "spring", damping: 21, stiffness: 180 }Framer Motion transition config for animations.
exitOffsetnumber-64Y-offset in pixels when a card exits the stack.
exitBlurnumber4Blur amount in pixels applied to exiting cards.
autoAdvancebooleanfalseEnables automatic card cycling.
autoAdvanceIntervalnumber5000Time in ms between auto-advances.
pauseOnHoverbooleantruePauses auto-advance when hovering.
activeIndexnumberundefinedControlled index of the currently active card.
onIndexChange(index: number) => voidundefinedCallback fired when the active index changes.
clickablebooleantrueAllows clicking the top card to advance.
keyboardNavigablebooleantrueEnables keyboard navigation with arrow keys.

CardStackIndicator

PropTypeDefaultDescription
totalCardsnumberRequiredTotal number of cards in the stack.
activeIndexnumberRequiredIndex of the currently active card.

CardOffset Type

PropertyTypeDefaultDescription
scalenumberRequiredScale factor applied to the card (1 = 100%).
ynumberRequiredVertical offset in pixels from the top.
opacitynumberundefinedOpacity of the card (0 to 1).