1.0.2 • Published 6 years ago

react-native-checkbox-view v1.0.2

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

react-native-checkbox-view

Installation

$ npm install react-native-checkbox-view --save

Usage

import Checkbox from 'react-native-checkbox-view';

Demo

Screenshots

Getting started

Add react-native-checkbox-view to your js file.

import CheckBox from 'react-native-checkbox-view'

Inside your component's render method, use CheckBox:

  <Checkbox
    style={{padding: 5}}
    checkBoxColor={color}
    onClick={(data) => this.onClick(data)} />

Then you can use it like this:

Basic usage

 <Checkbox
    style={{padding: 5}}
    checkBoxColor={color}
    onClick={(data) => this.onClick(data)} />

Custom CheckBox

  renderCheckBox(data, checkedImage, unCheckedImage) {
    return (
      <Checkbox
        style={{padding: 5}}
        checkedImage={checkedImage}
        unCheckedImage={unCheckedImage}
        onClick={(data) => this.onClick(data)} />
  }

API

PropsTypeOptionalDefaultDescription
styleViewPropTypes.styletrueCustom style checkbox
checkedImagePropTypes.elementtrueDefault imageCustom checked Image
unCheckedImagePropTypes.elementtrueDefault imageCustom unchecked Image
isCheckedPropTypes.boolfalsefalsecheckbox checked state
onClickPropTypes.func.isRequiredfalsecallback function
disabledPropTypes.booltruefalseDisable the checkbox button
checkBoxColorPropTypes.stringtrueTint color of the checkbox image (this props is for both checked and unchecked state)
checkedCheckBoxColorPropTypes.stringtrueTint color of the checked state checkbox image (this prop will override value of checkBoxColor for checked state)
uncheckedCheckBoxColorPropTypes.stringtrueTint color of the unchecked state checkbox image (this prop will override value of checkBoxColor for unchecked state)