


More components in Pro
Galleries, cards and interactive pieces for pages that need more than the basics.
items | CardSwapItem[] | Sample cards | Cards to show when no children are passed. Each item takes title, image, icon and alt. |
children | ReactNode | undefined | Your own cards. Wrap each one in the exported Card to get the matching tile style. |
width | 460 | Width of each card, in px. | |
height | 340 | Height of each card, in px. | |
cardDistance | 60 | Horizontal step between stacked cards, in px. | |
verticalDistance | 70 | Vertical step between stacked cards, in px. | |
depth | 90 | How far back each card sits, in px. More depth makes the cards behind smaller. | |
skewAmount | 6 | Slant of the cards, in degrees. | |
visibleCards | 4 | How many cards show in the stack. Extra cards wait hidden at the back. | |
delay | 4000 | Time between swaps, in ms. | |
autoplay | Sends the front card to the back on a timer. | ||
pauseOnHover | Pauses the timer while the cursor is over a card. | ||
draggable | Lets people drag or fling the front card to send it to the back. | ||
speed | Speed of the swap animation. | ||
bounce | 0.35 | How much the cards overshoot as they settle, from 0 to 1. | |
parallax | 0.5 | How much the stack shifts in depth as the cursor moves, from 0 to 1. | |
hoverSpread | 0.12 | How much the stack fans out while hovered. | |
dim | 0.5 | How much the cards behind fade back, from 0 to 1. | |
cardRadius | 18 | Corner 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) => void | undefined | Called when a card is clicked. Clicking a card behind also brings it to the front. |
onChange | (index: number) => void | undefined | Called with the index of the new front card after each swap. |
ref | { next, prev } | undefined | Call 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.
Sample cardschildrenReactNodeYour own cards. Wrap each one in the exported Card to get the matching tile style.
undefinedwidthnumberWidth of each card, in px.
460heightnumberHeight of each card, in px.
340cardDistancenumberHorizontal step between stacked cards, in px.
60verticalDistancenumberVertical step between stacked cards, in px.
70depthnumberHow far back each card sits, in px. More depth makes the cards behind smaller.
90skewAmountnumberSlant of the cards, in degrees.
6visibleCardsnumberHow many cards show in the stack. Extra cards wait hidden at the back.
4delaynumberTime between swaps, in ms.
4000autoplaybooleanSends the front card to the back on a timer.
pauseOnHoverbooleanPauses the timer while the cursor is over a card.
draggablebooleanLets people drag or fling the front card to send it to the back.
speednumberSpeed of the swap animation.
bouncenumberHow much the cards overshoot as they settle, from 0 to 1.
0.35parallaxnumberHow much the stack shifts in depth as the cursor moves, from 0 to 1.
0.5hoverSpreadnumberHow much the stack fans out while hovered.
0.12dimnumberHow much the cards behind fade back, from 0 to 1.
0.5cardRadiusnumberCorner radius of the cards, in px.
18introbooleanFans the cards out from the front one on mount.
theme'dark' | 'light'Color theme of the cards.
'dark'onCardClick(index: number) => voidCalled when a card is clicked. Clicking a card behind also brings it to the front.
undefinedonChange(index: number) => voidCalled with the index of the new front card after each swap.
undefinedref{ next, prev }Call next() or prev() to swap from your own controls.
undefinedExtra class names for the container.
Dependencies
2 required packages
npm install @hugeicons/react @hugeicons/core-free-icons


