Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@react-native-community/checkbox

Package Overview
Dependencies
Maintainers
29
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-native-community/checkbox

React Native Checkbox native modules for iOS & Android

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
28K
decreased by-69.15%
Maintainers
29
Weekly downloads
 
Created
Source

@react-native-community/checkbox

CircleCI Status Supports Android and iOS MIT License

React Native component used to select a single value from a range of values.

Alt text

Getting started

yarn add @react-native-community/checkbox

or

npm install @react-native-community/checkbox --save

Mostly automatic installation

react-native link @react-native-community/checkbox

Manual installation

Manually link the library on Android
android/settings.gradle
include ':@react-native-community/checkbox'
project(':@react-native-community/checkbox').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/checkbox/android')
android/app/build.gradle
dependencies {
   ...
   implementation project(':@react-native-community/checkbox')
}
android/app/src/main/.../MainApplication.java

On top, where imports are:

import com.reactnativecommunity.checkbox;

Add the checkbox class to your list of exported packages.

@Override
protected List<ReactPackage> getPackages() {
    return Arrays.asList(
            new MainReactPackage(),
            new CheckboxPackage()
    );
}

Migrating from the core react-native module

This module was created when the CheckBox was split out from the core of React Native. To migrate to this module you need to follow the installation instructions above and then change you imports from:

import { CheckBox } from 'react-native';

to:

import CheckBox from '@react-native-community/checkbox';

Usage

Example

import CheckBox from '@react-native-community/checkbox';
  <CheckBox
    value={true}
    disabled={false}
  />

Check out the example project for more examples.

Props

View props...

Prop nameDescription
disabledIf true the user won't be able to toggle the checkbox. Default value is false.
onChangeInvoked on change with the native event.
onValueChangeInvoked with the new boolean value when it changes.
valueThe value of the checkbox. If true the checkbox will be turned on. Default value is false.
tintColorsAn object with the following shape: { true?: ?ColorValue, false?: ?ColorValue }. The color value for true will be used when the checkbox is checked, and the color value for false will be used when it is off.
testIDUsed to locate this view in end-to-end tests.

Contributors

This module was extracted from react-native core. Please refer to https://github.com/react-native-community/react-native-checkbox/graphs/contributors for the complete list of contributors.

License

The library is released under the MIT licence. For more information see LICENSE.

Keywords

FAQs

Package last updated on 09 Jul 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc