1.0.5 • Published 4 years ago

rn-group-checkbox v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

rn-group-checkbox

NPM version License MIT

Checkbox Group component for react native, it works on iOS and Android.

Content

Installation

  • 1.Run npm i rn-group-checkbox --save OR yarn add rn-group-checkbox
  • 2.import GroupCheckBox from 'rn-group-checkbox'

Getting started

Add rn-group-checkbox to your js file.

import GroupCheckBox from 'rn-group-checkbox'

Inside your component's render method, use CheckBox:

<GroupCheckBox
    onClick = {(value)=>console.log(value)}
/>

Then you can use it like this:

Custom CheckBox

<GroupCheckBox
    style={{flex: 1, padding: 10}}
    labelPosition="left"
    labelStyle={{
        color:'Orange',
        fontSize:14
    }}
    data={["one","two","three"]}
    defaultValue = {["one"]}
    onClick={(value)=>{
      console.log(value)
    }}
   
/>

More Usage:

GitHubPopular

API

PropsTypeOptionalDefaultDescription
labelPositionPropTypes.oneOfleft/rightleftCustom style checkbox
labelStylePropTypes.objectCustom left Text style
dataPropTypes.array.isRequiredfalse"one","tow","three"any
checkboxCheckedStylePropTypes.objecttrueCustom checkbox checked style
checkboxUnCheckedStylePropTypes.objecttrueCustom checkbox unchecked style
checkedImageText.propTypes.styletrueCustom right Text style
unCheckedImagePropTypes.elementtrueDefault imageCustom unchecked Image
onClickPropTypes.func.isRequiredfalsecallback function
applyMaxConditionPropTypes.booltruefalseApply limit on checkbox items for check
maxAllowToCheckPropTypes.number1Total number of check box allow to check apply only when applyMaxCondition true
messageForMaxLimitExceedPropTypes.stringtruefalseShow Message then max checkbox limit exceeded
maxLimitExceedAlertButtonTextPropTypes.stringtrueOkayAlert button text
otherOptionPropTypes.booltruetrueShow other option
otherOptionLabelPropTypes.stringtrueOtherLabel for other checkbox
otherInputStylePropTypes.objecttrueCustomize other input box

Contribution

Issues are welcome. Please add a screenshot of bug and code snippet. Quickest way to solve issue is to reproduce it on one of the examples.

Pull requests are welcome. If you want to change API or making something big better to create issue and discuss it first.


MIT Licensed