0.0.4 • Published 6 years ago

react-heart-checkbox v0.0.4

Weekly downloads
9
License
MIT
Repository
github
Last release
6 years ago

react-heart-checkbox

Build Status

React heart checkbox - Online Demo

Usage

$ yarn add react-heart-checkbox
$ npm install -S react-heart-checkbox
import HeartCheckbox from 'react-heart-checkbox';

class Demo extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      checked: false
    };
  }

  onClick = (evnet, props) => {
    this.setState({ checked: !this.state.checked });
  }

  render() {
    const { checked } = this.state;

    return (
      <>
        <h1>{checked ? 'checked' : 'unchecked'}</h1>
        <HeartCheckbox checked={checked} onClick={this.onClick} />
      </>
    );
  }
}

render(<Demo />, document.getElementById("app"));