这是一个水波按钮的react组件封装
基于https://codepen.io/jh3y/pen/EKGXEY
a ripple-button component for React that from Ripple buttons https://codepen.io/jh3y/pen/EKGXEY
Installation
$ npm install react-ripple-button --save $ yarn add react-ripple-button
|
Usage
import RippleBtn from "react-ripple-button";
class App extends React.Component { render() { const onClick = () => { console.log(565); };
return <RippleBtn btnClassName="test" text="test" onClick={onClick} />; } }
export default App;
.test { background-color: red !important; width: 300px; height: 150px; }
|
Properties
static propTypes = { btnClassName: PropTypes.string, btnStyle: PropTypes.object, onClick: PropTypes.func.isRequired, text: PropTypes.string.isRequired };
static defaultProps = { btnClassName: "", btnStyle: {} };
|
License
MIT