AnimationsProNew

Sticky Hero Scroll

The first screen is pinned and shrinks with a slight tilt as you scroll, while the next section grows over it. A smooth hand-off between blocks.

Customize

heroColor
gridColor
nextTint
heroTextColor

Based on Sticky Hero Scroll (MIT license) ยท Terms of use

Props

14 properties
PropertyTypeDefaultDescription
heroReactNodeโ€”Content of the first screen that shrinks and tilts.
nextReactNodeโ€”Content of the next section that grows over it.
containerRefObject<HTMLElement | null>โ€”Scrolling element when the effect lives inside one. Without it the page scroll is used.
heightstring"100vh"Height of each section, any CSS length.
scaleTonumber0.8Scale the first screen shrinks to.
rotatenumber5Tilt in degrees.
showGridbooleantrueFaint grid behind the sections.
heroClassNamestringโ€”Classes of the first screen.
nextClassNamestringโ€”Classes of the next section.
heroColorstring"#ebebeb"Background of the hero. It darkens slightly towards the top.
gridColorstring"rgba(79, 79, 79, 0.18)"Colour of the grid lines.
nextTintstring"rgba(255, 255, 255, 0.06)"Glow at the top of the next section, over its near-black base.
heroTextColorstring"#000000"Text colour of the hero. Dark, so it reads on the coloured background.
classNamestringโ€”Extra classes.

Dependencies

3 required packages

npm install motion clsx tailwind-merge

Related components

View all