1.0.5 • Published 4 years ago
react-native-checkedbox v1.0.5
react-native-checkbox
A React Native checkbox with all the features, flexibility & Very easy to Use.
Why this Module?
Not so much complex & unnecessary thing Exists. All those basics functionality which everyone Needs. Everything with clear & simple!
Preview
Installation
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-checkedboxUsage
import 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;Props
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 |
Props Demonstration
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 backgroundFor Future Issues & Contributions
Any one can Contribute & in case of any issue, open the issue Forum!