Scroll & Motion

3D Parallax Depth Hero Section

A cinematic hero that uses scroll position to move three image layers backward while the centered headline scales up and comes forward. Reveals a call-to-action once the parallax completes. Ideal for image-heavy product launches, portfolio landings, and category overview pages.

Live preview

Loading preview

Requires framer-motion. React 18+ and Tailwind CSS v3+ assumed. Save as ParallaxDepthHero.tsx.

Or rebuild it with a prompt

Paste the prompt into the tool you already use. Each version is written specifically for that tool, matched to the same design constraints so the output stays consistent.

Build components/ParallaxDepthHero.tsx. Client component. Requires framer-motion. Outer wrapper: <section> of height 300vh with a ref. Inside: a sticky top-0 h-screen w-full overflow-hidden bg-white font-sans div. Renders three image layers (opacity 0.2 for layer 1, 0.4 for layer 2, 0.6 for layer 3) positioned absolutely at fixed top/left/right/width coordinates. Uses framer-motion useScroll with target on the outer section and offset ["start start","end end"]. Uses useTransform to translate each layer upward as you scroll (layer 3: 0 to -90%, layer 2: 0 to -65%, layer 1: 0 to -40%) and fade each to 0 opacity by 60% scroll. Centered headline (text-[20px] to text-[32px] responsive, font-semibold tracking-tight, max-w-2xl, text-black) scales from 0.6 to 1 and fades from 0.1 to 1 opacity as you scroll. A content row (subtitle + two CTAs) fades in at 60% to 85% scroll. Respect prefers-reduced-motion (all transforms disabled). Props: title?, subtitle?, primaryCta?, secondaryCta?, images? (DepthImage[]). Export DepthImage type. Single default export.

How to use it

  1. Use as the opening scene for image-heavy product launches, portfolio landings, or gallery homepages.
  2. Three layers of images give the depth: back, middle, front. Front recedes fastest on scroll.
  3. Uses framer-motion for smooth scroll timing. Responsive from phone to desktop.

Other components you might like

Related prompts for scroll & motion

Frequently asked questions

How do I use this component in my project?+

Copy the source file from the "Copy code" button and save it into your components folder. Add any listed dependencies (React 18 or later and Tailwind CSS v3 or later are always required, plus framer-motion or gradflow if the component lists them). Import and render the component wherever you want it. Every prop is optional and defaulted.

Can I customise the design and copy?+

Yes. Every component takes props for its content (headline, subtitle, image URL, CTA, and so on) and uses Tailwind classes throughout, so you can restyle without touching the logic. For deeper design changes, paste the prompt into Claude Code, Cursor, Lovable, Replit, or Codex and describe your brand tokens, spacing, or motion tweaks.

Are the components free for commercial use?+

Yes. Everything on this page is free to copy, adapt, and ship in commercial projects. No attribution required. If you post a public showcase we always appreciate a link back.

Which AI coding tool works best for these components?+

All five prompts produce the same design. Claude Code and Codex are best when you want the component slotted into a project with existing conventions. Cursor is ideal for editing inside your IDE with the file open. Lovable and Replit spin up a fresh preview fastest, useful for a quick play.

Do these work with Next.js, Vite, and Remix?+

Yes. The source files are plain React 18 client components. They run on any framework that supports React 18 and Tailwind CSS v3. If a component needs the "use client" directive (all of them do here, since they use hooks), keep the directive at the top of the file when you paste.