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
VaultScrollPile to Spread Cards
Photo Stack GalleryBrowse all 182Elastic Pill Menu
  • 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

Pile to Spread Cards

This one is free. Make an account and the code is yours, no card needed.

Create a free account

What you'll need.

Install

  • gsap
  • ScrollTrigger

Setup

npm i gsapregisterPlugin(ScrollTrigger)

More like this

  • Card
  • Grid
  • Pinned
  • Stagger
  • ScrollTrigger
  • Sticky

Features.

  • Four portrait cards sit in a messy pile in the middle of a sticky full-screen stage, each at its own tilt
  • Scrolling deals them out one after the other to their own tilted slots spread across the stage; scrolling back gathers them up
  • Each card scales down to fit its slot exactly, and turns to the slot's tilt on the way
  • Slot spots are plain CSS (top, left / right, rotate); move one and its card follows
  • Sizes and spots change at 992px and 768px, and are measured again on every resize
  • Respects prefers-reduced-motion: no scroll run, the cards simply sit in their slots

How to get it right.

Use portrait pictures

Cards and slots are both 3:4, so the cards land exactly on their slots. Pictures of another shape are cropped to 3:4 by object-fit: cover.

Keep the slots on the stage

Slots are placed in percentages of the stage, a full screen tall. Keep each one inside the stage, or its card is dealt off-screen and clipped (the stage has overflow: hidden).

Pick the pace

The track is three screens tall: one screen of stage, two of run (one and a half on phones). data-au-stagger sets how far apart the cards set off; 0 deals them all at once. data-au-scrub="0" locks them to the scroll bar.

Let the pile look loose

The pile tilts live in --ptg-pile-rot on each card (−8°, −2°, 5°, 10°), with small offsets in --ptg-pile-x / --ptg-pile-y. Keep them small and varied so it reads as a real pile.

Variations.

  • All at once — data-au-stagger="0"
  • One by one — data-au-stagger="0.4"
  • Locked to scroll — data-au-scrub="0"
  • Your palette — override --ptg-bg, --ptg-slot, --ptg-slot-line and --ptg-shadow on the track

Where it fits.

  • Portfolios — a stack of work spread out for a look
  • Lookbooks — a pile of looks pinned to the wall
  • Product launches — packaging or colourways dealt onto a table
  • Team pages — a pile of portraits sorted into a grid

Frequently asked.

Yes, as long as every [data-ptg-card] has a [data-ptg-slot]: card one goes to slot one, and so on. The CSS ships pile poses and slot spots for four; give any extra card and slot their own ptg_card--5 / ptg_slot--5 rules.

Change its top, left or right and rotate in the CSS. The script reads the layout box and the rotate, so a transform on the slot is not picked up.

So the wall reads as tidy and the pile as generous. The script scales each card by slot width ÷ card width; set --ptg-slot-w equal to --ptg-card-w for no scaling.

No. It works out each slot's centre, tilt and scale itself, so it only needs GSAP and ScrollTrigger.

No. It scrubs on scroll position, so it works with native scrolling and with any smooth-scroll library that updates ScrollTrigger.

Related components.

NewPro

Arc Collage Hero

Scroll

Pro

Rising Card on Scroll

Scroll

Pro

Outline Paint Reveal

Scroll