simpleParallax.js
v7.0.1Release notes

React parallax for any image.

A lightweight React component and JavaScript library that adds a parallax effect straight on your image tags. No background images, and it works with next/image.

$ npm i simple-parallax-js

Get started
Wet mountain road with a white center line running between pine trees under a misty sky, used to demo the parallax effect
Live playground
Change a setting, then scroll the page to see the effect.
Orientation
Higher = stronger effect, lower image quality.
The motion keeps going after you stop.
Overflow

Why use simpleParallax.js

<img />
No background image

Directly on image tags

The effect applies to the img itself. Any image works, including the next/image component.

React
Next.js
Vanilla JS
Any stack

React, Next.js & vanilla

Wrap an image in a React component, or use the vanilla build with simple-parallax-js/vanilla.

scale1.8
delay1.0s
scroll50%
Zero config

Simple by default, tunable

Change direction, scale, delay, transition, overflow or maxTransition only when you need to.

At a glance

What is simpleParallax.js?

simpleParallax.js is an open-source parallax library for React, Next.js and vanilla JavaScript. It adds a scroll-driven parallax effect directly to your img tags, with no background images needed. It is published on npm as simple-parallax-js under the MIT license.

It started as a jQuery plugin, became a vanilla JavaScript library, and is now built for React, with the vanilla build still available.

Figures from the npm registry and GitHub, checked on November 16, 2026.

Latest version
7.0.1
Released November 16, 2026
License
MIT
Free for personal and commercial use
Package size
51.0 kB
Unpacked on npm
Dependencies
0
React 17 or newer as a peer dependency
GitHub stars
2,160
Open source since November 2017
Weekly downloads
10.7k
npm, November 9 to 15, 2026
01 · Installation

Install the React parallax library

Install the package with your favorite package manager, then import it for React or for vanilla JavaScript.

npm install simple-parallax-js
import SimpleParallax from "simple-parallax-js";
02 · Initialization

Add a parallax effect to any image

Simply add the following JavaScript code. In vanilla JS, you can also apply the parallax to several images at once.

import SimpleParallax from "simple-parallax-js";

const Component = () => (
  <SimpleParallax>
    <img src="image.jpg" alt="image" />
  </SimpleParallax>
)
03 · Settings

Parallax settings: orientation, scale, delay & more

orientation

Stringdefault up

hint: up - right - down - left - up left - up right - down left - down right

This is the orientation (or direction) of the parallax effect. Choose up and when scrolling down, the image will translate from the bottom to the top (so the image will translate up). When scrolling up, the image will translate from the top to the bottom. Same logic applies for all other orientations (right, down, left, up left, up right, down left, or down right). When 2 directions are combined (for example down right), the image will translate diagonally.

See example →

scale

Numberdefault 1.5

hint: need to be above 1.0

The higher the scale is set, the more visible the parallax effect will be. In return, the image will lose in quality. To reduce the lossless effect, if the scale is set at 1.5 and your image is 500px width, do the simple math 500 * 1.5 = 750. So you can choose a 750px image to replace your 500px one and don't see any quality leak.

See example →

overflow

Booleandefault false

By default, the image is scaled to apply a parallax effect without any overflow on the layout. When overflow is set to true, the image will translate out of its natural flow (so it may overlap with your content).

See example →

delay

Numberdefault 0.4

hint: the delay is in second

When a delay is set, the translation of the image will continue during that delay when the user stops scrolling. That gives a very nice effect. The delay is in second.

See example →

transition

Stringdefault 'cubic-bezier(0,0,0,1)'

hint: any CSS transition

The transition setting works closely with the delay setting. This setting will add any CSS transition to the delay setting. For example, you can use ease or ease-in-out.

See example →

maxTransition

Numberdefault 0

hint: it should be a percentage between 1 and 99

The maxTransition setting should be used to stop the parallax animation after a given percentage. By default, it translates from 0% to 100% of the user viewport. You can change it here to any percentage you want.

See example →

customContainer

String or Nodedefault nullVanilla only

By default, the parallax calculation is done with the body scroll percentage. In some cases, the images may be in a container that has its own scroll area, so to have an accurate calculation, the custom container should be set.

customWrapper

Stringdefault nullVanilla only

In some cases, you want to use your own wrapper instead of the one created by the plugin. If you specify your custom wrapper, the plugin will add the simpleParallax class along with an overflow: hidden style.

04 · Methods

JavaScript parallax methods: refresh & destroy

refresh()

Vanilla version only

Refresh a simpleParallax instance, to recalculate all the positions.

var images = document.querySelectorAll('img');
var instance = new SimpleParallax(images);
instance.refresh();

destroy()

Vanilla version only

Destroy a simpleParallax instance.

var images = document.querySelectorAll('img');
var instance = new SimpleParallax(images);
instance.destroy();
05 · Examples

React parallax examples

Six live previews, one per setting. Each one is the exact code shown below it.

Scroll the page: each preview moves with your own scroll, using its own settings.
Winding wet road through a dark, misty pine forest

Basic config

defaults
import SimpleParallax from "simple-parallax-js";

const Component = () => (
  <SimpleParallax>
    <img src={"thumbnail.jpg"} alt={"image"} />
  </SimpleParallax>
)
Wet road curving past a guardrail and pine trees in thick fog

With a different direction

orientation="right"
import SimpleParallax from "simple-parallax-js";

const Component = () => (
  <SimpleParallax orientation="right">
    <img src={"thumbnail.jpg"} alt={"image"} />
  </SimpleParallax>
)
Gravel path winding through a sunlit spruce forest with moss on the ground

With a higher scale

scale={1.7}
import SimpleParallax from "simple-parallax-js";

const Component = () => (
  <SimpleParallax scale={1.7}>
    <img src={"thumbnail.jpg"} alt={"image"} />
  </SimpleParallax>
)
Wet mountain road with a white center line running between pine trees under a misty sky

The dashed green outline is only an illustration: it shows the image's original box and is not part of the effect.

With overflow

overflow
import SimpleParallax from "simple-parallax-js";

const Component = () => (
  <SimpleParallax overflow orientation="right">
    <img src={"thumbnail.jpg"} alt={"image"} />
  </SimpleParallax>
)
Empty wet road with yellow and white lines leading into a foggy mountain valley

With delay and transition

delay={1}
import SimpleParallax from "simple-parallax-js";

const Component = () => (
  <SimpleParallax delay={1} scale={1.5} transition="cubic-bezier(0,0,0,1)">
    <img src={"thumbnail.jpg"} alt={"image"} />
  </SimpleParallax>
)
Aerial view of a dense pine forest with a narrow dirt trail winding through the trees

With maxTransition

maxTransition={60}
import SimpleParallax from "simple-parallax-js";

const Component = () => (
  <SimpleParallax maxTransition={60}>
    <img src={"thumbnail.jpg"} alt={"image"} />
  </SimpleParallax>
)
06 · FAQ

React parallax: frequently asked questions

How do I add a parallax effect to an image in React?

Install simple-parallax-js, import SimpleParallax and wrap your img in it: <SimpleParallax><img src="image.jpg" alt="image" /></SimpleParallax>. The parallax applies directly to the image tag, so you need no background images and no extra CSS.

Does it work with Next.js and next/image?

Yes. Wrap the next/image Image component in SimpleParallax, exactly as you would a plain img. In the App Router, use it inside a Client Component with the "use client" directive.

Can I use simpleParallax.js without React?

Yes. Import the vanilla build from simple-parallax-js/vanilla, or use the SimpleParallax global, then call new SimpleParallax(images) on one or several img elements. The vanilla version also offers the refresh() and destroy() methods.

Does the parallax make the image overflow my layout?

Not by default. The image is scaled inside its wrapper, so the effect never overflows your layout. Set overflow to true if you want the image to translate outside its natural flow and overlap your content.

How do I change the direction, speed or intensity?

Use the settings: orientation (up, down, left, right or a diagonal), scale for the intensity, delay and transition for the easing, and maxTransition to stop the effect after a percentage of the viewport. Try them in the playground above.

Does it work on CSS background images?

No. simpleParallax.js is built for img tags, so use an img with object-fit: cover instead of a CSS background-image. It keeps your image accessible with alt text and compatible with next/image.

Is it free, and does it include TypeScript types?

It is free and open source under the MIT license. The npm package includes TypeScript type declarations for the React build.

Support the project

If you like simpleParallax.js, please consider supporting the project by giving it a star on GitHub.