Logo
React Bytes
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

cards
TypeCard[]
Default[]
Array of card objects. Each card: { id, image?: string, content?: ReactNode }. If empty, fallback demo cards are shown.
numberOfCards
Typenumber
Default10
Number of cards to display (min 3, max 10). Slices from the cards array or fallback demo cards.
radius
Typenumber
Default480
Radius of the circle in pixels.
duration
Typenumber
Default22
Duration of one full rotation in seconds.
cardWidth
Typenumber
Default162
Width of each card in pixels.
cardHeight
Typenumber
Default192
Height of each card in pixels.
height
Typenumber
Default500
Height of the container in pixels.
pauseOnHover
Typeboolean
Defaultfalse
Pause rotation when hovering over a card.
reverse
Typeboolean
Defaultfalse
Reverse the rotation direction.
draggable
Typeboolean
Defaulttrue
Enable drag to rotate the circle.
autoPlay
Typeboolean
Defaulttrue
Auto-play rotation animation.
onCardClick
Type(card: Card, index: number) => void
Defaultundefined
Callback fired when a card is clicked.
mouseWheel
Typeboolean
Defaulttrue
Enable mouse wheel to control rotation.
className
Typestring
Default""
Additional CSS classes for the container.
cardClassName
Typestring
Default""
Additional CSS classes for individual cards.
initialRotation
Typenumber
Default0
Initial rotation offset in degrees. Updates live when changed.
filterOnHover
Typeboolean
Defaulttrue
Toggle the grayscale/dark filter on a card when hovering over it.
defaultFiltered
Typeboolean
Defaulttrue
Whether cards start with the grayscale/dark filter applied by default. Hovering inverts this state per card.
entranceAnimation
Typeboolean
Defaulttrue
Enable/disable the entrance animation played when the component first mounts.
entranceType
Type"pop" | "fade" | "bottom" | "top" | "left" | "right" | "flip" | "spin" | "zoomBlur" | "scatter"
Default"pop"
Preset style for the mount entrance animation.
entranceDuration
Typenumber
Default0.9
Duration of the entrance animation in seconds.
entranceStagger
Typenumber
Default0.07
Delay (in seconds) between each card animating in during entrance.
entranceEase
Typestring
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