1.0.0 • Published 5 years ago

react-native-checkbox-cus v1.0.0

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

react-native-checkbox-cus

勾选框

安装

npm i --save react-native-checkbox-cus

展示

ui展示图

使用

import CheckBox from "react-native-checkbox-cus";

<CheckBox
    style={{flex: 1, padding: 10}}
    onClick={(isChecked)=>{

    }}
    leftText={"CheckBox"}
/>

 <CheckBox
            style={{flex: 1, padding: 10}}
            onClick={(isChecked)=>{
                 this.setState({
                     isChecked:!isChecked
                 })
               }}
            isChecked={this.state.isChecked}
            checkedImage={<Image source={require('../../page/my/img/ic_check_box.png')} style={this.props.theme.styles.tabBarSelectedIcon}/>}
            unCheckedImage={<Image source={require('../../page/my/img/ic_check_box_outline_blank.png')} style={this.props.theme.styles.tabBarSelectedIcon}/>}
        />

API

属性类型可选默认值描述
styleViewPropTypes.styletrueCustom style checkbox
leftTextPropTypes.stringtrueCustom left Text
leftTextStyleText.propTypes.styletrueCustom left Text style
rightTextPropTypes.stringtrueCustom right Text
rightTextViewPropTypes.elementtrueCustom right TextView
rightTextStyleText.propTypes.styletrueCustom right Text style
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)

欢迎交流

欢迎提问交流;若有bug,请添加bug截图或代码片段,以便更快更好的解决问题。 欢迎大家一起交流

我的博客