Rotating Cards
Customize
Props
| Property | Type | Default | Description |
|---|---|---|---|
cards | Card[] | [] | Array of card objects. Each card: { id, image?: string, content?: ReactNode }. If empty, fallback demo cards are shown. |
numberOfCards | number | 10 | Number of cards to display (min 3, max 10). Slices from the cards array or fallback demo cards. |
radius | number | 480 | Radius of the circle in pixels. |
duration | number | 22 | Duration of one full rotation in seconds. |
cardWidth | number | 162 | Width of each card in pixels. |
cardHeight | number | 192 | Height of each card in pixels. |
height | number | 500 | Height of the container in pixels. |
pauseOnHover | boolean | false | Pause rotation when hovering over a card. |
reverse | boolean | false | Reverse the rotation direction. |
draggable | boolean | true | Enable drag to rotate the circle. |
autoPlay | boolean | true | Auto-play rotation animation. |
onCardClick | (card: Card, index: number) => void | undefined | Callback fired when a card is clicked. |
mouseWheel | boolean | true | Enable mouse wheel to control rotation. |
className | string | "" | Additional CSS classes for the container. |
cardClassName | string | "" | Additional CSS classes for individual cards. |
initialRotation | number | 0 | Initial rotation offset in degrees. Updates live when changed. |
filterOnHover | boolean | true | Toggle the grayscale/dark filter on a card when hovering over it. |
defaultFiltered | boolean | true | Whether cards start with the grayscale/dark filter applied by default. Hovering inverts this state per card. |
entranceAnimation | boolean | true | Enable/disable the entrance animation played when the component first mounts. |
entranceType | "pop" | "fade" | "bottom" | "top" | "left" | "right" | "flip" | "spin" | "zoomBlur" | "scatter" | "pop" | Preset style for the mount entrance animation. |
entranceDuration | number | 0.9 | Duration of the entrance animation in seconds. |
entranceStagger | number | 0.07 | Delay (in seconds) between each card animating in during entrance. |
entranceEase | string | "back.out(1.4)" | GSAP ease string used for the entrance animation (e.g. "power2.out", "elastic.out(1, 0.5)"). |
cardsCard[]Array of card objects. Each card: { id, image?: string, content?: ReactNode }. If empty, fallback demo cards are shown.
[]numberOfCardsnumberNumber of cards to display (min 3, max 10). Slices from the cards array or fallback demo cards.
10radiusnumberRadius of the circle in pixels.
480durationnumberDuration of one full rotation in seconds.
22cardWidthnumberWidth of each card in pixels.
162cardHeightnumberHeight of each card in pixels.
192heightnumberHeight of the container in pixels.
500pauseOnHoverbooleanPause rotation when hovering over a card.
falsereversebooleanReverse the rotation direction.
falsedraggablebooleanEnable drag to rotate the circle.
trueautoPlaybooleanAuto-play rotation animation.
trueonCardClick(card: Card, index: number) => voidCallback fired when a card is clicked.
undefinedmouseWheelbooleanEnable mouse wheel to control rotation.
trueclassNamestringAdditional CSS classes for the container.
""cardClassNamestringAdditional CSS classes for individual cards.
""initialRotationnumberInitial rotation offset in degrees. Updates live when changed.
0filterOnHoverbooleanToggle the grayscale/dark filter on a card when hovering over it.
truedefaultFilteredbooleanWhether cards start with the grayscale/dark filter applied by default. Hovering inverts this state per card.
trueentranceAnimationbooleanEnable/disable the entrance animation played when the component first mounts.
trueentranceType"pop" | "fade" | "bottom" | "top" | "left" | "right" | "flip" | "spin" | "zoomBlur" | "scatter"Preset style for the mount entrance animation.
"pop"entranceDurationnumberDuration of the entrance animation in seconds.
0.9entranceStaggernumberDelay (in seconds) between each card animating in during entrance.
0.07entranceEasestringGSAP ease string used for the entrance animation (e.g. "power2.out", "elastic.out(1, 0.5)").
"back.out(1.4)"Dependencies
Crafted withbyMohammad Tasin



