react-ripple-button

这是一个水波按钮的react组件封装
基于https://codepen.io/jh3y/pen/EKGXEY

react-ripple-button

a ripple-button component for React that from Ripple buttons https://codepen.io/jh3y/pen/EKGXEY

Installation

1
2
$ npm install react-ripple-button --save
$ yarn add react-ripple-button

Usage

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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;

//css
.test {
background-color: red !important;
width: 300px;
height: 150px;
}

Properties

1
2
3
4
5
6
7
8
9
10
11
static propTypes = {
btnClassName: PropTypes.string, //Custom component name
btnStyle: PropTypes.object, //Custom component style
onClick: PropTypes.func.isRequired,
text: PropTypes.string.isRequired //Custom component content
};

static defaultProps = {
btnClassName: "",
btnStyle: {}
};

License

MIT

PenZ wechat
交个朋友吧
点滴分享,您的支持将极大的鼓励我!