Layout & Scroll4 min read
Spring-Tension Parallax Header with Sticky Morph
Direct Definition & Architecture
A parallax header separates visual background displacement from foreground content through fractional scroll velocity. On upward overscroll, it expands proportionally with elastic rubber-band tension; on downward scroll, it collapses smoothly into a compact navigation bar.
Live Physics Canvas
120 FPS GPU RenderStiffness (Tension)340
Damping (Friction)22
Technical Specifications
Layout Shift (CLS)
0.000 Zero CLS
Event Overhead
Passive scroll listener with RAF throttle
Compatibility
Modern CSS scroll-timeline & Framer Motion
State Machine Graph
NormalFull 320px hero state with background imagery.
OverscrollScale factor expands past 1.0 with rubber-band damping.
CollapsedFixed 72px sticky navigation bar with high blur.
Production Code Output
parallax-header.jsx
import React from 'react';
import { motion, useScroll, useTransform } from 'framer-motion';
export function ParallaxHeader({ title = "Explore ExodeUI", imageUrl }) {
const { scrollY } = useScroll();
const headerHeight = useTransform(scrollY, [0, 240], [320, 72]);
const imageScale = useTransform(scrollY, [-150, 0, 240], [1.3, 1, 0.9]);
const titleScale = useTransform(scrollY, [0, 240], [1.25, 0.95]);
return (
<motion.header
style={{ height: headerHeight }}
className="sticky top-0 z-50 w-full overflow-hidden bg-stone-900 border-b border-stone-800"
>
<motion.div
style={{ scale: imageScale }}
className="absolute inset-0 bg-cover bg-center opacity-60"
style={{ backgroundImage: `url(${imageUrl || '/assets/hero-bg.webp'})` }}
/>
<div className="absolute inset-0 bg-gradient-to-t from-stone-950 via-transparent" />
<motion.div
style={{ scale: titleScale }}
className="relative h-full flex items-end p-6 max-w-5xl mx-auto"
>
<h1 className="text-white font-bold text-2xl sm:text-3xl">{title}</h1>
</motion.div>
</motion.header>
);
}Architectural Breakdown
Fixed headers consume valuable mobile screen space, while basic disappearing headers cause disorientation.
This pattern scales image scale dynamically during overscroll and transitions smoothly into a compact glass navigation bar during reading mode.
All transformations use transform3d to bypass main-thread layout recalculations.
Frequently Asked Questions
Explore Related Motion Guides & Tooling
Build your next living interface today.
Design fluid physics and visual logic in ExodeUI and export directly to React, Swift, and Flutter.