All Projects → react-native-checkbox → React Native Checkbox

react-native-checkbox / React Native Checkbox

Licence: mit
Checkbox component for React Native

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to React Native Checkbox

Compoundbuttongroup
An Android library to easily implement compound buttons
Stars: ✭ 52 (-73.06%)
Mutual labels:  checkbox
React Checkbox Group
Sensible checkbox groups manipulation for DOM.
Stars: ✭ 109 (-43.52%)
Mutual labels:  checkbox
React Svg Map
A set of React.js components to display an interactive SVG map
Stars: ✭ 150 (-22.28%)
Mutual labels:  checkbox
Multipicker
Form styling plugin for jQuery
Stars: ✭ 90 (-53.37%)
Mutual labels:  checkbox
Vue Table Dynamic
🎉 A dynamic table with sorting, filtering, editing, pagination, multiple select, etc.
Stars: ✭ 106 (-45.08%)
Mutual labels:  checkbox
Nativescript Checkbox
NativeScript plugin for checkbox UI component
Stars: ✭ 113 (-41.45%)
Mutual labels:  checkbox
Vue Svg Map
A set of Vue.js components to display an interactive SVG map
Stars: ✭ 48 (-75.13%)
Mutual labels:  checkbox
Awesome Bootstrap Checkbox
✔️Font Awesome Bootstrap Checkboxes & Radios. Pure css way to make inputs look prettier
Stars: ✭ 2,044 (+959.07%)
Mutual labels:  checkbox
Jhform
JhForm - 自定义表单工具,更加简单,快捷的创建表单、设置页面
Stars: ✭ 108 (-44.04%)
Mutual labels:  checkbox
Snapchatcheckbox
A Snapchat-inspired checkbox.
Stars: ✭ 147 (-23.83%)
Mutual labels:  checkbox
Selectionlist
Simple single-selection or multiple-selection checklist, based on UITableView
Stars: ✭ 93 (-51.81%)
Mutual labels:  checkbox
Xamarincontrols
Cross-platform controls for Xamarin and Xamarin.Forms.
Stars: ✭ 104 (-46.11%)
Mutual labels:  checkbox
Pretty Checkbox
A pure CSS library to beautify checkbox and radio buttons.
Stars: ✭ 1,708 (+784.97%)
Mutual labels:  checkbox
Magic Input
CSS3 Styles for Checkbox and Radio Button inputs look prettier. with only one element.
Stars: ✭ 81 (-58.03%)
Mutual labels:  checkbox
Angular Bootstrap Checkbox
A checkbox for AngularJS styled to fit the Twitter Bootstrap standard design
Stars: ✭ 154 (-20.21%)
Mutual labels:  checkbox
Ckdcss
A tiny set of micro interactions for your checkboxes.
Stars: ✭ 49 (-74.61%)
Mutual labels:  checkbox
Ember Toggle
Checkbox based Toggle Switches for Ember
Stars: ✭ 111 (-42.49%)
Mutual labels:  checkbox
Flutter smart select
SmartSelect allows you to easily convert your usual form select or dropdown into dynamic page, popup dialog, or sliding bottom sheet with various choices input such as radio, checkbox, switch, chips, or even custom input. Supports single and multiple choice.
Stars: ✭ 179 (-7.25%)
Mutual labels:  checkbox
React Icheck
🔘 iCheck components built with React. Highly customizable checkbox, radio buttons and radio group.
Stars: ✭ 175 (-9.33%)
Mutual labels:  checkbox
Bootstrap Table
An extended table to integration with some of the most widely used CSS frameworks. (Supports Bootstrap, Semantic UI, Bulma, Material Design, Foundation, Vue.js)
Stars: ✭ 11,068 (+5634.72%)
Mutual labels:  checkbox

@react-native-community/checkbox

CircleCI Status Supports Android, iOS and Windows MIT License npm version Lean Core Extracted

React Native component for Checkbox

Android Example IOS Example Windows Example

Support

RN version Checkbox version
> 0.60 & < 0.62 >= 0.3 (Support IOS from 0.4)
< 0.60 0.2 (only Android)
>= 0.62 to run on Windows 0.5

Getting started

yarn add @react-native-community/checkbox

or

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

On iOS, install cocoapods:

npx pod-install

On Windows with RNW 62 or earlier, you need to manually link the module (on RNW 63 and later autolinking will work).

Mostly automatic installation

From react-native >= 0.60 autolinking will take care of the link (on iOS and Android)

for react-native =< 0.59.X

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

Add the checkbox class to your list of exported packages.

@Override
protected List<ReactPackage> getPackages() {
    return Arrays.asList(
            new MainReactPackage(),
            new ReactCheckBoxPackage()
    );
}
Manually link the library on Windows

Add the CheckboxWindows project to your solution

  1. Open the solution in Visual Studio 2019.
  2. Right-click solution icon in Solution Explorer > Add > Existing Project. Select 'D:\pathToYourApp\[email protected]\checkbox\windows\CheckboxWindows\CheckboxWindows.vcxproj'.

windows/myapp.sln

Add a reference to CheckboxWindows to your main application project. From Visual Studio 2019:

Right-click main application project > Add > Reference... Check 'CheckboxWindows' from the 'Project > Solution' tab on the left.

pch.h

Add #include "winrt/CheckboxWindows.h".

app.cpp

Add PackageProviders().Append(winrt::CheckboxWindows::ReactPackageProvider()); before InitializeComponent();.

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 your imports from:

import { CheckBox } from 'react-native';

to:

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

Usage

Example

import CheckBox from '@react-native-community/checkbox';
  const [toggleCheckBox, setToggleCheckBox] = useState(false)

  <CheckBox
    disabled={false}
    value={toggleCheckBox}
    onValueChange={(newValue) => setToggleCheckBox(newValue)}
  />

Check out the example project for more examples.

Props

Common Props

View props...

Prop name Type Description
onChange function Invoked on change with the native event.
onValueChange function Invoked with the new boolean value when it changes.
value boolean The value of the checkbox. If true the checkbox will be turned on. Default value is false.
testID string Used to locate this view in end-to-end tests.
disabled boolean If true the user won't be able to toggle the checkbox. Default value is false.

Android Only Props

Prop name Type Description
tintColors string An 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.

IOS Only Props

Prop name Type Description
lineWidth number The width of the lines of the check mark and box. Defaults to 2.0.
hideBox boolean Control if the box should be hidden or not. Defaults to false
boxType 'circle' or 'square' The type of box to use. Defaults to 'circle'
tintColor string The color of the box when the checkbox is Off. Defaults to '#aaaaaa'
onCheckColor string The color of the check mark when it is On. Defaults to '#007aff'
onFillColor string The color of the inside of the box when it is On. Defaults to transparent
onTintColor string The color of the line around the box when it is On. Defaults to '#007aff'
animationDuration number The duration in seconds of the animations. Defaults to 0.5
onAnimationType 'stroke' or 'fill' or 'bounce' or 'flat' or 'one-stroke' or 'fade' The type of animation to use when the checkbox gets checked. Default to 'stroke'
offAnimationType 'stroke' or 'fill' or 'bounce' or 'flat' or 'one-stroke' or 'fade' The type of animation to use when the checkbox gets unchecked. 'stroke'

Windows Props

Implemented most of iOS and Android props. Defaults for color styling can be referenced here: https://docs.microsoft.com/en-us/dotnet/framework/wpf/controls/checkbox-styles-and-templates

Prop name Type Description
disabled boolean If true the user won't be able to toggle the checkbox. Default value is false.
tintColor string The color of the box when the checkbox is Off.
onCheckColor string The color of the check mark when it is On.
onFillColor string The color of the inside of the box when it is On.
onTintColor string The color of the line around the box when it is On.

Contributors

This module was extracted from react-native core.

The implementaion of IOS version refered to BEMCheckBox

License

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].