A React Native checkbox with all the features, flexibility & Very easy to Use.
Not so much complex & unnecessary thing Exists. All those basics functionality which everyone Needs.
Everything with clear & simple!
Insert Image Here //TODO
As this module depends on nothing means no dependency require so, just 1 below step require to install it.
npm install react-native-checkedboxor
yarn add react-native-checkedboximport CheckBox from 'react-native-checkedbox';import React from 'react';
const someComponent = props => {
const [isChecked, setIsChecked] = useState(false);
const handleOnPress = val => { //true | false
setIsChecked(val);
}
// You can also handle in this way below;
//const handleOnPress = () => { //true | false
// setIsChecked(!isChecked);
//}
return (
<CheckBox
value={isChecked} // Telling CheckBox if it should be ticked or not!!!
onPress={handleOnPress} // Function called when user presses CheckBox
/>
);
}
export default someComponent;CheckBox component accepts following props.
| Name | Type | Default | Is Require | What Value? |
|---|---|---|---|---|
| value | bool | false | Yes | true or false |
| onPress | func | - | Yes | only func |
| disabled | bool | false | No | true or false |
| tickColor | string | white | No | hex/rgb/color |
| backgroundColor | string | blue | No | hex/rgba/color |
const [isDisabled, setIsDisabled] = useState(true);
<CheckBox
value={isChecked}
onPress={handleOnPress}
disabled={isDisabled} // Turn it to true if you want to disable checkBox.
tickColor={'yellow'} // Any String Value for CheckBox Tick
backgroundColor={'red'} // Any String Value for CheckBox background
/>I developed all the functionality, if their will need for any, I'll do it.
Any one can Contribute & in case of any issue, open the issue Forum!