react-paper-ripple
Version:
Paper ripple animations inspired by Google Material Design.
88 lines (55 loc) • 2.25 kB
Markdown
[](https://badge.fury.io/js/react-paper-ripple)
[](https://david-dm.org/souporserious/react-paper-ripple)
Paper ripple animations inspired by Google Material Design.
`npm install react-paper-ripple --save`
```html
<script src="https://unpkg.com/react-paper-ripple/dist/react-paper-ripple.js"></script>
(UMD library exposed as `ReactPaperRipple`)
```
[](http://codepen.io/souporserious/pen/ALBYdJ)
```js
import PaperRipple from 'react-paper-ripple'
class App extends Component {
render() {
return (
<section>
<PaperRipple color="#f55c03" center className="btn btn-circle btn-red">
<i className="icon fa fa-bomb"/>
</PaperRipple>
<PaperRipple color="#03c8f5" center className="btn btn-circle btn-blue">
<i className="icon fa fa-diamond"/>
</PaperRipple>
<PaperRipple color="#f55c03" center className="btn btn-circle btn-red">
<i className="icon fa fa-hand-peace-o "/>
</PaperRipple>
</section>
)
}
}
```
The wrapping element around your element. Defaults to `div`. Any other valid props like `className` will be passed to this element.
The color of the wave. Passed as `backgroundColor` to private `Wave` component.
The opacity of the waves container.
The amount the wave should grow compared to the biggest axis of the element.
Position the wave in the center of the element.
Pass in any valid [React Motion config object](https://github.com/chenglou/react-motion#--spring-val-number-config-springhelperconfig--opaqueconfig).
clone repo
`git clone git@github.com:souporserious/react-paper-ripple.git`
move into folder
`cd ~/react-paper-ripple`
install dependencies
`npm install`
run dev mode
`npm run dev`
open your browser and visit: `http://localhost:8080/`