0.5.17 • Published 4 months ago

@react-native-community/checkbox v0.5.17

Weekly downloads
27,274
License
MIT
Repository
github
Last release
4 months ago

@react-native-community/checkbox

CircleCI Status Supports Android MIT License npm version Lean Core Extracted

Note: checkbox doesn't support iOS. Please use Switch for iOS. If you think it is necessary to support iOS, please discuss here

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

From react-native >= 0.60 autolinking will take care of the link, just don't forget to run pod install after adding this pakage

for react-native =< 0.59.X

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

Manual installation

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.ReactCheckBoxPackage;

Add the checkbox class to your list of exported packages.

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

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.

License

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

@neur0base/app-sdkreact-native-oreopsnewtw-reactnativetemplatei-invest-wealtholx-mallwidget_tikket@infinitebrahmanuniverse/nolb-_react-n@maryury/widgettelecel-foundation-updatedordering-ui-react-native@otesbylhe/reusablecomponents@everything-registry/sub-chunk-765digimonk_native_clied-componentstw-reactnative@eventvm/evtmobilekitviettel-ekycvtcc-ekycvtcc-ekyc-sdk@eohjsc/react-native-hts@eohjsc/react-native-personal-health@eohjsc/react-native-smart-city@eohjsc/react-native-smart-parkingtelecel-foundationmodule-native-gbmodule-native-svdda-fb-mvp@oreops2021/react-native-oreopscore@lgowrav/testapp@nafkhanzam/react-native-components@pawans/htmsreact-exoordering-ui-native-releaseordering-ui-native-ubanku-releasenpsmobileautomationonboarding-widget-uswa-module-shared@ezri00/trackappform-1gatec-rn-frameworkreact-native-select-multi-contactsreact-native-select-contactsreact-native-signup-checkboxreact-native-signup-form@proximus/myproximus-design-systemreact-native-nestedlistreact-native-nested-checboxes@react-native-form/checkboxreact-native-video-conference-tsreact-native-oreopscorereact-native-rainbowfeedbackreactnativepluginfeedbacksamplefeedback-component-ai-dda@hinh-eoh/test_publishpiktor-profile@kafudev/react-native-core@kafudev/react-native-shellreact-native-template-twreact-native-template-tw-app-basern-ui-builderrn-vayvayrnshell@ada-support/react-native-sdkreact_native_reusable_componentiat-app-alpha@revodigital/evt-mobile-kit@aionz/nativesample-package-react-native@bit-ui-libs/mobileai-component-mvpkiwi-bundle-reactantimpackageapp-studio-widgets@didcky/jaijagga@devesharp/reactsmcinsurancelatter-react@fuchsia-for-all/primitives
0.5.17

4 months ago

0.5.16

10 months ago

0.5.15

1 year ago

0.5.14

1 year ago

0.5.13

1 year ago

0.5.10

2 years ago

0.5.11

2 years ago

0.5.12

2 years ago

0.5.9

3 years ago

0.5.8

3 years ago

0.5.7

3 years ago

0.5.6

3 years ago

0.5.5

4 years ago

0.5.4

4 years ago

0.5.3

4 years ago

0.5.2

4 years ago

0.5.1

4 years ago

0.5.0

4 years ago

0.4.2

4 years ago

0.4.1

4 years ago

0.4.0

4 years ago

0.3.0

4 years ago

0.2.2

4 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.0

5 years ago

1.0.0

5 years ago