1.0.5 • Published 2 years ago

react-native-checkedbox v1.0.5

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

react-native-checkbox

Build Status npm

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-checkedbox

or

yarn add react-native-checkedbox

Usage

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.

NameTypeDefaultIs RequireWhat Value?
valueboolfalseYestrue or false
onPressfunc-Yesonly func
disabledboolfalseNotrue or false
tickColorstringwhiteNohex/rgb/color
backgroundColorstringblueNohex/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 background

For Future Issues & Contributions

Any one can Contribute & in case of any issue, open the issue Forum!