Back to blocks
Before After Scroll React component

What is this?

As you scroll, the screen stays put. Before wipes sideways into After, then a third photo grows in and fills the view. Swap labels, photos, and notes, then drop it into a beauty or product landing page.

Full TSX source. No account needed.

home-point-ba.tsx

"use client"; import { useEffect, useRef, useState } from "react";import gsap from "gsap";import { ScrollTrigger } from "gsap/ScrollTrigger";import { getScrollParent, isElementScrollRoot } from "@/lib/studioPreviewMotion";import { clamp01, cn } from "@/lib/utils"; 

Read the guide

BlockPass

Before After Scroll

As you scroll, the screen stays put. Before wipes sideways into After, then a third photo grows in and fills the view. Swap labels, photos, and notes, then drop it into a beauty or product landing page.

Checking access…
Live Preview

Verified Technical Spec

Animation
GSAP
Reduced motion
Verified
Keyboard focus
Not detected in source
Compatibility
Tailwind CSS v3.4 + v4 · React 19 / Next.js 15 App Router + Vite / Remix compatible

Included

  • Copy source into Cursor or Claude for agent install
  • Responsive on phone, tablet, and desktop
  • Finished React · TypeScript · Tailwind CSS · GSAP UI

Dependencies

  • React 19.0.0
  • Typescript 5.7.2
  • Tailwindcss 3.4.16
  • GSAP 3.15.0

Tech Stack

  • React
  • TypeScript
  • Tailwind CSS
  • GSAP

Version 1.0.0