Platform
VaultVault
  • Free15
  • Navigation19
  • Buttons9
  • Scroll55
  • Text27
  • Sliders & marquees19
  • Gallery & images67
  • Cursor24
  • Page transitions10
  • Loaders2
  • Backgrounds10
  • UI components33
ButtonsPart of ProButtons
IconsPart of ProIcons
  • Interface Essentials144
  • Social Icons69
  • Payment Badges41
SavedPart of ProSaved
Support
DocumentationDocumentation
MCP serverMCP server
SettingsSettings
VaultGallery & imagesFanning Image Cards
Full-Bleed Image ExpandBrowse all 182Card Stack Tabs
  • Free15
  • Navigation19
  • Buttons9
  • Scroll55
  • Text27
  • Sliders & marquees19
  • Gallery & images67
  • Cursor24
  • Page transitions10
  • Loaders2
  • Backgrounds10
  • UI components33
  • Interface Essentials144
  • Social Icons69
  • Payment Badges41
Sign inSign in

Start free. The code for 15 components, no card needed.

Get 15 free

Fanning Image Cards

This one is locked. Become a member to open the code for it and the rest of the Vault.

See plansTry the 15 free ones

What you'll need.

Install

  • gsap

Setup

npm i gsap

More like this

  • Card
  • Elastic

Features.

  • A tight, slightly fanned stack that springs open into an arc when the pointer reaches it
  • The card under the pointer lifts 5% and comes to the front
  • Aim at an outer card and the whole fan opens up to 50% wider, with a deeper arc, so it never covers its neighbours
  • Opening, re-aiming and closing all use the same springy 0.7s ease
  • Touch: tap a card to open and aim, tap the front card again to close
  • Keyboard: every card is a focusable button; focus aims, Enter or Space toggles, tabbing away closes
  • Scales with its font size, and tightens on phones (767px and below)
  • Respects prefers-reduced-motion: the cards jump to each pose instead of springing
  • GSAP only, plain CSS for the look

How to get it right.

Five is the sweet spot

The fan is built around an odd number of cards so one sits in the middle. Three feels thin; seven needs a wide screen or a smaller spread.

Give it the width

Open, five cards at the default spread reach about 380px either side of the centre, plus up to 50% when an outer card is aimed at. The stack is min(94vw, 93.75em) wide, but its parent shouldn't clip it.

Use portrait images that work small

Cards are 0.78 wide-to-tall and overlap heavily at rest, so pick pictures with a clear subject in the middle.

Keep the lean modest

8° per step tilts the outer cards to 16° (and up to 24° when one is aimed at). Past 12 the outer cards start to look like they're falling.

Variations.

  • Default — 190px spread, 8° lean, 16px arc
  • Flat row — data-au-arc="0" and data-au-lean="0": the cards slide into a straight line
  • Tight hand — data-au-spread="120" and data-au-lean="12": a deck of cards held in one hand
  • Big arc — data-au-arc="32" for a rainbow-shaped fan
  • Your colours — override --cfn-card and --cfn-focus on .cfn_stack

Where it fits.

  • Collections — a set of artworks or products in one compact spot, like this demo
  • Portfolio sections — five project covers that open up on hover
  • Team intros — portraits that fan out to say hello
  • Album or book art — a series shown as a hand of cards

Frequently asked.

Any number. Each [data-cfn-card] gets a step from the middle; odd counts keep one card in the centre. For more than five, lower spread so the fan fits.

Set font-size on .cfn_stack, or override --cfn-card-width. The px spread and arc scale with the font size too.

The face is a button that aims the fan, so a link inside it would fight the tap and keyboard handling. Put links next to the fan instead, or handle a second click yourself.

Below 768px the spread and arc are multiplied by 0.52 and the cards shrink to fit the screen.

No. Load gsap before the script; nothing else is needed.

Related components.

Pro

File Drawer Cards

Hover

Pro

Capsule Image Hero

Click

Pro

Depth Fly-Through Hero

Load