0.0.2 • Published 4 years ago

@cptdoraemon/parallax-container v0.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

parallax-container

A React component wrapper for parallax effect.

Install

npm install --save @cptdoraemon/parallax-container

Usage

import * as React from 'react'
import ParallaxContainer from "parallax-container"

function WrappedComponent() {
    return (
        <div>
            <h1>Title</h1>
            <p>Contents</p>
        </div>
    )
}

interface AppProps {
    backgroundUrl: string
}

function App(props: AppProps) {
    return (
        <ParallaxContainer backgroundUrl={props.backgroundUrl}>
            <WrappedComponent />
        </ParallaxContainer>
    )
}

Example

Demo

License

MIT © CptDoraemon