1.0.1 • Published 2 years ago

react-native-multi-checkbox v1.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

react-native-multi-checkbox

Multiple Checkbox component for React Native, it works on both iOS and Android.

Content

Installation

  • 1.Run npm i react-native-multi-checkbox --save
  • 2.import MultiCheckbox from 'react-native-multi-checkbox'

Getting started

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

import MultiCheckbox from 'react-native-multi-checkbox'

Add Inside render method of component , use MultiCheckbox component:

<MultiCheckbox
    style={{flex:1, paddingBottom:10}}
    items={[{ id: 1,  label: "item 1" }, { id: 2, label: "item 2" }]}
    labelPosition="right"
    checkBoxColor="#fff"
    checkedCheckBoxColor="#fff"
    defaultSelected={[2]}
    onPress={handleCheckboxChange}
    labelStyle={{color: '#000000'}}
    itemStyle={{marginBottom: 10}}
/>

API

PropsOptionalDefaultDescription
styletrueCustom style for section
itemStyletrueCustom style for item (checckbox & label)
labelStyletrueCustom style for label
itemsfalseArray data for items
defaultSelectedtrueArray of id's
labelPositiontrueRightPosition of lable
checkedCheckboxImagetrueCheckbox imageCustom checked Image
unCheckedCheckboxImagetrueUnchecked checkbox imageCustom unchecked Image
onPressfalseCallback function
checkBoxColortrueCheckbox image tint color
checkedCheckBoxColortrueChecked checkbox image tint color

Contribution

If there are any Issues then welcome. please attach screenshot of code and issue. Will solve issue ASAP.

Pull requests, feedbacks and suggestions are welcome!