1.0.1 • Published 3 years ago

react-native-sonwan-test v1.0.1

Weekly downloads
7
License
MIT
Repository
github
Last release
3 years ago

:white_check_mark: react-native-checkbox-lite

A liteweight checkbox component for react native. It works on Android, iOS and Expo web. No dependency installation required.

:blue_book: Installation:

Install the component through npm using:

npm i react-native-checkbox-lite

:microscope: Example:

import React from 'react';
import { StyleSheet, View } from 'react-native';

import CheckBox from 'react-native-checkbox-lite';

export default function App() {

  const [isChecked, setIsChecked] = React.useState(true);

  function toogleCheckBox() {
    setIsChecked(!isChecked);
  }

  return (
    <View style={styles.container}>
      <CheckBox text={'CheckBox Text'} isChecked={isChecked} onPress={toogleCheckBox} checkBoxColor={'#2980b9'} />
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#fff',
    alignItems: 'center',
    justifyContent: 'center',
  },
});

:coffee: API

PropsTypeOptionalDefaultDescription
styleStyleSheet styletrueStyle object of checkbox container
checkBoxSizeinttrue24Pixel size of checkbox image
checkBoxColorstringtrue#000Hex color code of checkbox image
isCheckedbooltruefalseCheckbox checked state
onPressfunctiontrueCallback function when pressed
textstringtrueCheckbox TextText that will be displayed along the checkbox
textStyleStyleSheet styletrueStyle object of the text

:wrench: Issues

Issues are welcome. Please create a new issue under the issues tab.

MIT Licensed