Card Shuffle
A slanted stack of cards receding into depth: on a timer, a drag or a click the front card drops away and returns at the back while the others step forward.
pixikit.com/docs/components/card-shuffle
Customize
Width460px
Height340px
Card distance60px
Vertical distance70px
Depth90px
Skew amount6.0°
Visible cards4
Delay4000ms
Autoplay
Pause on hover
Draggable
Speed1.00
Bounce0.35
Parallax0.50
Hover spread0.12
Dim0.50
Card radius18px
Intro
Theme
Easing
Props
26| Name | Type | Default | Description |
|---|---|---|---|
items | CardShuffleItem[] | None | Cards to show when no children are passed. Each item takes title, image, icon and alt. |
children | ReactNode | None | Your own cards. Wrap each one in the exported Card to get the matching tile style. |
width | number | 460 | Width of each card, in px. |
height | number | 340 | Height of each card, in px. |
cardDistance | number | 60 | Horizontal step between stacked cards, in px. |
verticalDistance | number | 70 | Vertical step between stacked cards, in px. |
depth | number | 90 | How far back each card sits, in px. More depth makes the cards behind smaller. |
skewAmount | number | 6 | Slant of the cards, in degrees. |
visibleCards | number | 4 | How many cards show in the stack. Extra cards wait hidden at the back. |
delay | number | 4000 | Time between swaps, in ms. |
autoplay | boolean | true | Sends the front card to the back on a timer. |
pauseOnHover | boolean | true | Pauses the timer while the cursor is over a card. |
draggable | boolean | true | Lets people drag or fling the front card to send it to the back. |
speed | number | 1 | Speed of the swap animation. |
bounce | number | 0.35 | How much the cards overshoot as they settle, from 0 to 1. |
parallax | number | 0.5 | How much the stack shifts in depth as the cursor moves, from 0 to 1. |
hoverSpread | number | 0.12 | How much the stack fans out while hovered. |
dim | number | 0.5 | How much the cards behind fade back, from 0 to 1. |
cardRadius | number | 18 | Corner radius of the cards, in px. |
intro | boolean | true | Fans the cards out from the front one on mount. |
theme | "dark" | "light" | "dark" | Color theme of the cards. |
onCardClick | (index: number) => void | None | Called when a card is clicked. Clicking a card behind also brings it to the front. |
onChange | (index: number) => void | None | Called with the index of the new front card after each swap. |
ref | Ref<CardShuffleHandle> | None | Call next() or prev() to swap from your own controls. |
easing | "elastic" | "linear" | "elastic" | Elastic settles with the bounce above; linear moves the cards without any overshoot. |
className | string | "" | Extra class names for the container. |