
React Scroll Parallax
React hooks and components to create parallax scroll effects for banners, images or any other DOM elements. Utilizes Parallax Controller to add vertical or horizontal scrolling based effects to elements. Optimized to reduce jank on scroll and works with SSR and SSG rendered React apps.
If you're coming from V2, here's a migration guide.
Installâ
With npm
npm install react-scroll-parallax
Exampleâ
Create effects with a hook:
function Component() {
const parallax = useParallax({
speed: -10,
});
return <div ref={parallax.ref} />;
}
or with a component:
function Component() {
return (
<Parallax speed={-10}>
<div />
</Parallax>
);
}
Getting Startedâ
Demosâ
- Storybook v3 - Source Code
- Demo 1 - Source Code
- Horizontal Scroll - Source Code
- Full Page Banner - Source Code
- Demo 2 - Source Code (old 2.x version)