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
VaultScrollTorn Paper Swap
3D Tilt CardsBrowse all 182Looping Typewriter
  • 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

Torn Paper Swap

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
  • ScrollTrigger
  • three

Setup

npm i gsapregisterPlugin(ScrollTrigger, three)

More like this

  • Pinned
  • Reveal
  • ScrollTrigger
  • Sticky
  • Canvas
  • WebGL

Features.

  • A pinned, full-screen scroll transition between two pictures and their titles
  • The first picture rips away from the bottom up onto a plain sheet of paper, then the paper rips away onto the second
  • The torn edge creeps and reshapes as it climbs instead of sliding, with fray, hanging fibres and a pulp rim
  • Every length is in CSS pixels, so the rip keeps its scale on any screen
  • Only the paper is WebGL: the pictures are plain <img> tags and the titles real text
  • Scrubbed by ScrollTrigger and drawn only when the scroll or size changes
  • Falls back to a clean swap at halfway without WebGL
  • Respects prefers-reduced-motion: no paper, the pictures swap at halfway

How to get it right.

Load GSAP, ScrollTrigger and three.js first

The script reads window.gsap, window.ScrollTrigger and window.THREE. Load all three before code.js. If three never arrives, the section still swaps the pictures at halfway.

Give it room to scroll

The section is --tpp-length tall (400vh by default) with a sticky stage inside, and the whole length minus one screen drives both tears. Don't put it inside a parent with overflow: hidden, or the stage stops sticking.

Keep plate B first in the markup

Plate B sits under plate A and stays hidden until the frame is fully papered (46%–54% of the scroll), when it fades in under the sheet. The order in code.html is what stacks them.

Shape the tear

data-au-jagged scales the big slanted swell, data-au-fibre the fray and hanging fibres, data-au-rim the width of the pulp rim. Bigger values need more margin, which the script adds above and below the frame for you.

Retheme with variables

--tpp-paper and --tpp-rim colour the sheet and its torn edge (read once at init). --tpp-fg and --tpp-muted colour the titles and any labels, --tpp-bg shows behind the pictures while they load.

Labels are optional

It ships with a title on each picture and no label. To add one, put <p class="tpp_label"> under a title (label on the slide in React).

Variations.

  • Newsprint — the default: jagged 0.6, fibre 0.6, rim 6px, light paper
  • Clean cut — data-au-jagged="0.2", data-au-fibre="0", data-au-rim="0" for a crisp, low edge
  • Rough card — data-au-jagged="1.1", data-au-fibre="1.2", data-au-rim="10" for thick, fibrous board
  • Peach paper — --tpp-paper: #f68e66 for a warm sheet between the pictures
  • Long tear — --tpp-length: 600vh so each rip takes longer

Where it fits.

  • Before / after — the same place at two times, two seasons or two stages of a build
  • Editorial features — a tactile chapter break between two photo stories
  • Portfolio case studies — moving from the brief to the result
  • Print, stationery or packaging brands — the paper is the point

Frequently asked.

That's the fallback: no WebGL, three.js not loaded, or reduced motion switched on.

GSAP and ScrollTrigger must load before the script; after 10 seconds without them the console says [oomph] Torn Paper: gsap or ScrollTrigger not found.

Not in one section. Stack two sections for a longer sequence, with the second starting on the first's last picture.

They're meant to: the canvas sits above the titles, so each title tears away with its picture. Title B is fully shown once the second tear has cleared it.

Yes. It listens to ScrollTrigger, so Lenis or any scroller that updates ScrollTrigger works.

Related components.

NewPro

Arc Collage Hero

Scroll

Pro

Rising Card on Scroll

Scroll

Pro

Outline Paint Reveal

Scroll