Blue hour
Blue hour
Moonrise
Moonrise
Dusk
Dusk
Pink drift
Pink drift
Card Distance
60px
Vertical Distance
70px
Depth
90px
Skew
6°
Visible Cards
4
Card Radius
18px
Delay
4000ms
Speed
Bounce
0.35
Parallax
0.5
Hover Spread
0.12
Dim
0.5

More components in Pro

Galleries, cards and interactive pieces for pages that need more than the basics.

View all 255
25 properties
itemsCardSwapItem[]Sample cardsCards to show when no children are passed. Each item takes title, image, icon and alt.
childrenReactNodeundefinedYour own cards. Wrap each one in the exported Card to get the matching tile style.
width460Width of each card, in px.
height340Height of each card, in px.
cardDistance60Horizontal step between stacked cards, in px.
verticalDistance70Vertical step between stacked cards, in px.
depth90How far back each card sits, in px. More depth makes the cards behind smaller.
skewAmount6Slant of the cards, in degrees.
visibleCards4How many cards show in the stack. Extra cards wait hidden at the back.
delay4000Time between swaps, in ms.
autoplaySends the front card to the back on a timer.
pauseOnHoverPauses the timer while the cursor is over a card.
draggableLets people drag or fling the front card to send it to the back.
speedSpeed of the swap animation.
bounce0.35How much the cards overshoot as they settle, from 0 to 1.
parallax0.5How much the stack shifts in depth as the cursor moves, from 0 to 1.
hoverSpread0.12How much the stack fans out while hovered.
dim0.5How much the cards behind fade back, from 0 to 1.
cardRadius18Corner radius of the cards, in px.
Fans the cards out from the front one on mount.
theme'dark' | 'light''dark'Color theme of the cards.
onCardClick(index: number) => voidundefinedCalled when a card is clicked. Clicking a card behind also brings it to the front.
onChange(index: number) => voidundefinedCalled with the index of the new front card after each swap.
ref{ next, prev }undefinedCall next() or prev() to swap from your own controls.
Extra class names for the container.
itemsCardSwapItem[]

Cards to show when no children are passed. Each item takes title, image, icon and alt.

DefaultSample cards
childrenReactNode

Your own cards. Wrap each one in the exported Card to get the matching tile style.

Defaultundefined
widthnumber

Width of each card, in px.

Default460
heightnumber

Height of each card, in px.

Default340
cardDistancenumber

Horizontal step between stacked cards, in px.

Default60
verticalDistancenumber

Vertical step between stacked cards, in px.

Default70
depthnumber

How far back each card sits, in px. More depth makes the cards behind smaller.

Default90
skewAmountnumber

Slant of the cards, in degrees.

Default6
visibleCardsnumber

How many cards show in the stack. Extra cards wait hidden at the back.

Default4
delaynumber

Time between swaps, in ms.

Default4000
autoplayboolean

Sends the front card to the back on a timer.

pauseOnHoverboolean

Pauses the timer while the cursor is over a card.

draggableboolean

Lets people drag or fling the front card to send it to the back.

speednumber

Speed of the swap animation.

bouncenumber

How much the cards overshoot as they settle, from 0 to 1.

Default0.35
parallaxnumber

How much the stack shifts in depth as the cursor moves, from 0 to 1.

Default0.5
hoverSpreadnumber

How much the stack fans out while hovered.

Default0.12
dimnumber

How much the cards behind fade back, from 0 to 1.

Default0.5
cardRadiusnumber

Corner radius of the cards, in px.

Default18
introboolean

Fans the cards out from the front one on mount.

theme'dark' | 'light'

Color theme of the cards.

Default'dark'
onCardClick(index: number) => void

Called when a card is clicked. Clicking a card behind also brings it to the front.

Defaultundefined
onChange(index: number) => void

Called with the index of the new front card after each swap.

Defaultundefined
ref{ next, prev }

Call next() or prev() to swap from your own controls.

Defaultundefined

Extra class names for the container.

Dependencies

2 required packages

npm install @hugeicons/react @hugeicons/core-free-icons