A modest Checkbox Component for React Native

About

A customizable checkbox component for React Native that supports setting a custom image or component as the checkbox. Inspired by react-native-checkbox.

Install

$ npm install --save react-native-modest-checkbox
$ yarn add react-native-modest-checkbox

Usage

demo

// ... Imagine imports here
import Checkbox from 'react-native-modest-checkbox'

export default class App extends Component {
  render() {
    return (
      <View style={styles.container}>
        <Checkbox
          label='Text for checkbox'
          onChange={(checked) => console.log('Checked!')}
        />
      </View>
    );
  }
}

const styles = StyleSheet.create({
// Imagine some amazing styles right here..
})

AppRegistry.registerComponent('App', () => App);

You can use your own images for the checkbox states:

<CheckBox checkedImage={require('./path/to/image.png')} uncheckedImage={require('./path/to/otherImage.png')} />

It can also be used with your own components for the checkbox states:

// Using react-native-vector-icons

<CheckBox
  checkedComponent={<Icon name="hand-peace-o" size={25} color="#222" />}
  uncheckedComponent={<Icon name="hand-paper-o" size={25} color="#222" />}
  label='Custom Component'
  onChange={(checked) => console.log('Checked!')}
/>

Contribute

Contributions are welcome. Please open up an issue or create PR if you would like to help out.

Note: If editing the README, please conform to the standard-readme specification.

Download Details:

Author: tiaanduplessis

GitHub: https://github.com/tiaanduplessis/react-native-modest-checkbox

#react-native #programming

A modest Checkbox Component for React Native
3.55 GEEK