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
VaultScrollSticky Chapter Swap
Expanding Card ModalBrowse all 182Cloth Bend Gallery
  • 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

Sticky Chapter 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
  • SplitText
  • CustomEase

Setup

npm i gsapregisterPlugin(ScrollTrigger, SplitText, CustomEase)

More like this

  • Pinned
  • Reveal
  • Split text
  • ScrollTrigger
  • Parallax
  • Sticky

Features.

  • Chapter rows on a hairline grid, 3 / 6 / 3 columns, with each 3:4 picture bleeding to the screen edge on alternate sides
  • On screens 992px and wider, every chapter's label and headline ride one sticky stage in the middle column and swap line by line as each row takes over
  • Lines leave through their masks and the new ones rise in behind them, the label a beat later; scrolling up plays it the other way
  • A fast fling goes straight to the right chapter instead of playing every one in between
  • Pictures sit slightly zoomed and drift as they cross the screen, each chapter at its own speed
  • Below 992px the rows stack (copy, then picture) with no swaps; the drift stays, gentler
  • Respects prefers-reduced-motion: no drift, and chapters swap instantly

How to get it right.

Keep headlines short

The stage is one row tall and every chapter's copy sits in the same spot. Two or three lines per headline (max 20 characters a line wide) keeps the swap tidy; very long copy can outgrow the row.

Give it the full width

The hairlines and the bleeding pictures are built on the section's own margins (--chs-margin, 2.5em). Put it full-width in the page, not inside a padded container.

Tune the swap and the drift

data-au-duration sets how long the new lines take to rise (the old ones leave in 60% of it). data-au-drift sets how far the pictures travel; 0 keeps them still.

Let the runway work

The script pads the top and bottom of the section so the stage rests centred on the first chapter and is still centred as the last one ends. Don't add your own padding to the section.

Variations.

  • Quick swap — data-au-duration="0.5"
  • Still pictures — data-au-drift="0"
  • More chapters — copy a row; add chs_row--flip to every other one to keep the pictures alternating
  • Your palette — override --chs-bg, --chs-fg, --chs-muted, --chs-line and --chs-accent on the section

Where it fits.

  • Case studies — challenge, approach, result
  • Brand stories — founding, making, today
  • Product pages — one feature per chapter, one picture each
  • Editorial — a short story in parts

Frequently asked.

Any number from two up. The swap lines are measured per row, so a fourth or fifth row just adds another swap.

Below 992px the rows stack, so each chapter's copy sits right above its own picture and there is nothing to swap. Only the picture drift runs there.

Yes. The label is plain markup: a word and a number. To name a chapter, add <span class="chs_dot" aria-hidden="true">&middot;</span><span>Name</span> after the number (name in React). Edit the parts freely, but keep the [data-chs-label] element: the script needs it. The number takes --chs-accent.

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

Headlines are split into lines, and line breaks depend on the font. The script starts once document.fonts.ready resolves, so the lines match what you see.

Related components.

NewPro

Arc Collage Hero

Scroll

Pro

Rising Card on Scroll

Scroll

Pro

Outline Paint Reveal

Scroll