react-css-parallax
A css-based parallax background to be used with react
Demo
https://kevinrodriguez-io.github.io/react-css-parallax
Install
npm install --save react-css-parallax
Features
- Relies on
backgroundAttachment
- Supports
fixed
to disable the parallax effect - Simple, customizable api
- Adds underlying, hidden img tag when alt is present
- Supports passProps
Usage
import React Component from 'react' import Parallax from 'react-css-parallax' { return <Parallax ="https://kevinrodriguez.io/kevinbackground.jpg" ="A nice keyboard" ="100vh" /> <Parallax ="https://kevinrodriguez.io/kevinbackground.jpg" ="A nice keyboard" ="100vh" /> }
License
MIT © kevinrodriguez-io