Fold
Inspect
Sections that fold into each other as you scroll. The direct children are the panels; each one takes a mode, from its data-fold attribute or the mode prop:
pinholds the panel while the next scrolls over it. Withscale,rotationor an overlay it shrinks, tilts and dims underneath; with astackOffsetthe panels stack like cards.parallaxmoves the panel down while the next enters.revealuncovers the panel from behind the one before it.
data-fold-y, data-fold-opacity and data-fold-overlay tune one panel. The panels must be adjacent siblings in normal flow: reveal on the first and pin or parallax on the last do nothing. Below 768px a parallax simplifies to a pin.
Lineage: darkroom.engineering's satus Fold, rewritten on GSAP ScrollTrigger so it composes with the page's other triggers. The direction page is the live use: the hero parallaxes under chapter two, chapters two and three pin while the next wipes across, and the voice cards are a pinned stack.
Examples
The three modes
Inspect
Stacked cards
Inspect
Props
as:div,mainorsection(div)mode: mode for every child; unset, only tagged children foldscale: how much a pinned panel shrinks while the next lands, 0 to 1 (0)rotation: degrees a pinned panel tilts, alternating sides (0)overlay: how dark a covered panel gets, 0 to 1 (0)overlayColor(black)y: parallax distance in pixels (400; reveal defaults to0)offsetTop: pixels from the top where the first pinned panel rests (0)stackOffset: pixels each pinned panel rests below the one before (0)scrollsItself: when the element scrolls rather than the windowmobile:{ breakpoint, strategy }, strategysimplify|disable|same
Reduced motion renders the panels in plain flow.