0.1.4 • Published 6 years ago

react-animated-checkbox v0.1.4

Weekly downloads
112
License
ISC
Repository
github
Last release
6 years ago

react-animated-checkbox

A React component for animated checkbox

Demo

GIF

Installation

npm install --save react-animated-checkbox

Usage

import CheckBox from "react-animated-checkbox"
...
<CheckBox
  checked={this.state.checked}
  checkBoxStyle={{
    checkedColor: "#34b93d",
    size: 100,
    unCheckedColor: "#b8b8b8"
  }}
  duration={400}
  onClick={()=>this.handleClick()}
/>

A more detailed example can be found here.

Props

PropertyTypeExplanation
checkedbooleanthe checkbox animates when this property changes from false to true
checkBoxStyle.checkedColorstringcheckbox color when property checked is true
checkBoxStyle.unCheckedColorstringcheckbox color when property checked is false
checkBoxStyle.sizenumbercheckbox size in pixels
durationnumberanimation duration in ms
onClickfunctionthis function is called when the checkbox is clicked