🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

react-parallax

Package Overview
Dependencies
Maintainers
1
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-parallax

A React Component for parallax effect.

0.1.0
Source
npm
Version published
Weekly downloads
14K
4.38%
Maintainers
1
Weekly downloads
 
Created
Source

react-parallax

A react component for simple parallax effect

Install

npm install react-parallax --save-dev

Demo

Usage

var Parallax = require('react-parallax');

var TheContainer = React.createClass({
  render: function () {
    return (
      <div>
      	<Parallax bgImage="assets/1.jpg" strength={300}>
			<h1>first parallax section</h1>
			<h2>with some crazy text</h2>
			<br/>
			<h2>it's just there to fill the website</h2>
			<br/>
		</Parallax>
		<Parallax bgColor="white">
			<br/>
			<h1>second parallax is without bg image</h1>
			<br/>
		</Parallax>
		<Parallax bgImage="assets/2.jpg">
			<br/>
			<h1>its the third</h1>
			<br/>
			<h2>hello hello</h2>
			<br/>
		</Parallax>
      </div>
    )
  }
});

Props

  • bgImage: path to the background image that makes parallax effect visible - (type: String)
  • bgColor: css value for a background color (visible only if bgImage is NOT set), eg.: #ddd, yellow, rgb(34,21,125) - (type: String)
  • strength: parallax effect strength (in pixel), default 100. this will define the amount of pixels the background image is translated - (type: Number)
  • blur: pixel value for background image blur, default: 0 - (type: Number)

Children

The children are used to display any content inside the react-parallax component

Development

Initial set up, run:

npm install

For watch on files, live reload, JSX transpiling and browserify, run:

grunt

Port on Windows is 80, 8080 on all other OS by default. Can be set with option -port=8080

License

MIT

Keywords

react

FAQs

Package last updated on 03 Jul 2015

Did you know?

Socket

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.

Install

Related posts