Skip to content

Block 296 of 297

Horizontal Scroll Story

Big-number story chapters that pin and slide sideways as the page scrolls, with a progress line. Stacks on phones.

Puck key
ScrollHorizontalBlock
Export
scrollHorizontalBlock
React component
<ScrollHorizontal />
Files
components/puck/scroll-horizontal-block.tsx
components/puck/scroll-horizontal.client.tsx
Dependencies
gsap
License
MIT (GSAP has its own license)

About this block

When to use it, how to write for it, and what to change in the code.

What it's for

A story told in up to eight chapters, each with a kicker, big number, label, title, body and optional portrait photo. On tablets and desktops the section pins in place and the chapters slide sideways as the reader scrolls down, with a progress line and chapter counter. On phones, or with reduced motion, the chapters stack as a normal list.

  • A year-in-review or annual report narrative
  • A campaign's progress told in phases
  • Program results walked through season by season
Writing the content
  • Keep Big number short, like "4,200", "92%" or "1st"; leave it blank for a text-only chapter.
  • Use Number label to say what the figure counts, and Kicker for sequence, such as "Chapter 2 · Spring".
  • Chapters allows 1 to 8, and the pinned scroll only starts with two or more. Four to six keeps the scroll length reasonable.
  • Add a Source line whenever the numbers come from a report.
Accessibility
  • Chapters are an ordered list in reading order, and chapter titles sit one heading level below the section heading (WCAG 1.3.1).
  • Pinning runs only on screens 768px and wider with no reduced-motion preference; everyone else gets a plain stack or swipe row (WCAG 2.3.3).
  • The progress line and counter are aria-hidden, since the list itself already gives the order.
Customizing the code
  • Requires gsap with ScrollTrigger and scroll-horizontal.client.tsx. The pin condition is the gsap.matchMedia query, and scrub: 0.8 sets how closely the row follows the scroll.
  • Chapter width is md:w-4/5 lg:w-3/5 xl:w-1/2 on each panel.

Editor fields

What content editors see in the P1 sidebar when they select this block.

  • Eyebrowtext
  • Headingtext
  • Heading levelselect
  • Introtextarea
  • Chaptersarray
  • Source linetext