Skip to content
Components65 / 118

Fan Stack

A stack of cards that fans out like files when you come near. Closed, the ones behind peek over the top; bring the cursor in and they fan out sideways in 3D, the card under the cursor lifting toward you with its label while its neighbours lean away. Click a card to bring it to the front, or drag one out and flick it to send it round to the back of the deck. A glossy sheen slides over them as they turn.

Card stack3D fanFlick to shuffleSpring physicsSheenGSAP
Hover to fan, then over a cardClick to bring forward, flick to send back

Tweak

LIVE

Cards

240px

Number the labels

Fan

0.58
30°

Props

8 props
  • cards{ src; label?; alt? }[]
    The cards: an image and an optional label.
  • widthnumber
    Card width, px.default 260
  • aspectnumber
    Width / height.default 1.3
  • spreadnumber
    How far the fan spreads (card widths per card).default 0.58
  • turnnumber
    Degrees each card turns when fanned.default 30
  • numberedboolean
    Number the labels (01, 02...).default true
  • onSelect(card, index) => void
    Called when a card is clicked (it also comes to the front).
  • classNamestring
    Extra classes.