/react-smart-parallax

A smart parallax which will measure the overflow and calculate the correct scroll speed for the image

Primary LanguageJavaScriptMIT LicenseMIT

react-smart-parallax

A smart parallax which will measure the overflow and calculate the correct scroll speed for the image.

npm Maintenance npm David CircleCI

Installation

yarn add react-smart-parallax

Install peer dependencies:

yarn add react react-dom prop-types react-jss

Usage

import Parallax from 'react-smart-parallax';
import React from 'react';

function Component() {
  return (
    <Parallax img="https://website.com/image.png">
      The content in front of the image. This can be empty aswell.
    </Parallax>
  );
}

Props

img (required)

The url to the image.

children

The content to render in front of the image.

className

An additional className to be applied to the root element.

License

MIT