npm.io
1.0.1 • Published 9 years ago

react-appear

Licence
MIT
Version
1.0.1
Deps
2
Vulns
0
Weekly
0
Stars
8
Install scriptsThis package runs scripts during installation (preinstall/install/postinstall)

react-appear

Use in-viewport to trigger transitions on your components when they become visible in the viewport

npm i -S react-appear

See the demo

Usage

const Example = () => (
  <Appear className='MyTransition'>
    <img src="http://placekitten.com/g/200/300"/>
  </Appear>
)

Initially, your component will be wrapped in <div class="MyTransition"></div>.

When entering the viewport, the div will get additional MyTransition--inViewport className.

You need to define the CSS rules, example :

.MyTransition {
  opacity: 0;
  transition: all 0.5s ease-out;
}

.MyTransition--inViewport {
  opacity: 1;
}

License

react-appear is available under MIT. See LICENSE for more details.

Keywords