
Security News
ESLint Adds Official Support for Linting HTML
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
react-parallax
Advanced tools
A React Component for parallax effect working in client-side and server-side rendering environment
npm install react-parallax --save
import React from 'react';
import { Parallax, Background } from 'react-parallax';
const MyComponent = () => (
<div>
<Parallax
blur={10}
bgImage={require('path/to/image.jpg')}
bgImageAlt="the cat"
strength={200}
>
Put some text content here
or even an empty div with fixed dimensions
to have a height for the parallax.
<div style={{ height: '200px' }} />
</Parallax>
<Parallax
blur={{ min: -15, max: 15 }}
bgImage={require('path/to/another/image.jpg')}
bgImageAlt="the dog"
strength={200}
>
Blur transition from min to max
<div style={{ height: '200px' }} />
</Parallax>
<Parallax strength={300}>
<div>Use the background component for custom elements</div>
<Background className="custom-bg">
<img src="http://www.fillmurray.com/500/320" alt="fill murray" />
</Background>
</Parallax>
</div>
);
export default MyComponent;
For more flexibility and styling purposes you can add a <Background></Background>
section to your Parallax Container. Child nodes inside this Background will be positioned like the bgImage behind the other children. Compared to the bgImage there is no automatic scaling (see above).
sizes
attributesrcset
attribute{min:0, max:5}
for dynamic blur depending on scroll positionAre used to display any content inside the react-parallax component
Initial set up, run:
npm install / yarn
Development, live reload, JSX transpiling, run:
npm run dev
Port 3000 on all OS by default. Can be set with option -port=8080
MIT
FAQs
A React Component for parallax effect working in client-side and server-side rendering environment
The npm package react-parallax receives a total of 11,869 weekly downloads. As such, react-parallax popularity was classified as popular.
We found that react-parallax demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
Security News
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.