Checkbox component for React native
Install the component through npm using:
npm install react-native-checkbox --save
import CheckBox from 'react-native-checkbox';
<CheckBox
label='Label'
checked={true}
onChange={(checked) => console.log('I am checked', checked)}
/>
label
: text that will be displayed along the checkboxlabelBefore
: position the label before the checkbox (boolean). The default value is falselabelStyle
: style object that will be applied to the labelchecked
: initial checked valuecheckedImage
: checked image (e.g.: require('PATH_TO_IMAGE'))checkboxStyle
: style object that will be applied to the checkboxuncheckedImage
: unchecked image (e.g.: require('PATH_TO_IMAGE'))onChange
: callback function that will be invoked with the toggled checked property as argument.containerStyle
: style object that will be applied to the containerunderlayColor
: style the touchable component underlay coloraccessible
: indicates whether view is an accessible elementaccessibilityLabel
: maps to content description / label for Android automationtestID
: maps to id / name for iOS automation.gitignore
# Logs
logs
*.log
# Runtime data
pids
*.pid
*.seed
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# node-waf configuration
.lock-wscript
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules
# vim
*.sw*
# osx
.DS_Store
Author: sconxu
Source: https://github.com/sconxu/react-native-checkbox