Skip to content
PixiKit

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
NameTypeDefaultDescription
itemsCardShuffleItem[]NoneCards to show when no children are passed. Each item takes title, image, icon and alt.
childrenReactNodeNoneYour own cards. Wrap each one in the exported Card to get the matching tile style.
widthnumber460Width of each card, in px.
heightnumber340Height of each card, in px.
cardDistancenumber60Horizontal step between stacked cards, in px.
verticalDistancenumber70Vertical step between stacked cards, in px.
depthnumber90How far back each card sits, in px. More depth makes the cards behind smaller.
skewAmountnumber6Slant of the cards, in degrees.
visibleCardsnumber4How many cards show in the stack. Extra cards wait hidden at the back.
delaynumber4000Time between swaps, in ms.
autoplaybooleantrueSends the front card to the back on a timer.
pauseOnHoverbooleantruePauses the timer while the cursor is over a card.
draggablebooleantrueLets people drag or fling the front card to send it to the back.
speednumber1Speed of the swap animation.
bouncenumber0.35How much the cards overshoot as they settle, from 0 to 1.
parallaxnumber0.5How much the stack shifts in depth as the cursor moves, from 0 to 1.
hoverSpreadnumber0.12How much the stack fans out while hovered.
dimnumber0.5How much the cards behind fade back, from 0 to 1.
cardRadiusnumber18Corner radius of the cards, in px.
introbooleantrueFans the cards out from the front one on mount.
theme"dark" | "light""dark"Color theme of the cards.
onCardClick(index: number) => voidNoneCalled when a card is clicked. Clicking a card behind also brings it to the front.
onChange(index: number) => voidNoneCalled with the index of the new front card after each swap.
refRef<CardShuffleHandle>NoneCall 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.
classNamestring""Extra class names for the container.

More interaction components in Pro

View all

Related