Menu
Rotating Cards
1
2
3
4
5
6
7
8
9
10
Customize
Radius390
Duration (s)22
Card Width165
Card Height154
Number of Cards10
Initial Rotation0
Entrance Duration (s)0.9
Entrance Stagger (s)0.02
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)"). |
cardsTypeCard[]
Default
[]Array of card objects. Each card: { id, image?: string, content?: ReactNode }. If empty, fallback demo cards are shown.
numberOfCardsTypenumber
Default
10Number of cards to display (min 3, max 10). Slices from the cards array or fallback demo cards.
radiusTypenumber
Default
480Radius of the circle in pixels.
durationTypenumber
Default
22Duration of one full rotation in seconds.
cardWidthTypenumber
Default
162Width of each card in pixels.
cardHeightTypenumber
Default
192Height of each card in pixels.
heightTypenumber
Default
500Height of the container in pixels.
pauseOnHoverTypeboolean
Default
falsePause rotation when hovering over a card.
reverseTypeboolean
Default
falseReverse the rotation direction.
draggableTypeboolean
Default
trueEnable drag to rotate the circle.
autoPlayTypeboolean
Default
trueAuto-play rotation animation.
onCardClickType(card: Card, index: number) => void
Default
undefinedCallback fired when a card is clicked.
mouseWheelTypeboolean
Default
trueEnable mouse wheel to control rotation.
classNameTypestring
Default
""Additional CSS classes for the container.
cardClassNameTypestring
Default
""Additional CSS classes for individual cards.
initialRotationTypenumber
Default
0Initial rotation offset in degrees. Updates live when changed.
filterOnHoverTypeboolean
Default
trueToggle the grayscale/dark filter on a card when hovering over it.
defaultFilteredTypeboolean
Default
trueWhether cards start with the grayscale/dark filter applied by default. Hovering inverts this state per card.
entranceAnimationTypeboolean
Default
trueEnable/disable the entrance animation played when the component first mounts.
entranceTypeType"pop" | "fade" | "bottom" | "top" | "left" | "right" | "flip" | "spin" | "zoomBlur" | "scatter"
Default
"pop"Preset style for the mount entrance animation.
entranceDurationTypenumber
Default
0.9Duration of the entrance animation in seconds.
entranceStaggerTypenumber
Default
0.07Delay (in seconds) between each card animating in during entrance.
entranceEaseTypestring
Default
"back.out(1.4)"GSAP ease string used for the entrance animation (e.g. "power2.out", "elastic.out(1, 0.5)").
Dependencies
gsap 3.15.0
Crafted withbyMohammad Tasin
