{"id":18488422,"url":"https://github.com/react-native-checkbox/react-native-checkbox","last_synced_at":"2025-04-08T21:30:31.885Z","repository":{"id":38213816,"uuid":"169448579","full_name":"react-native-checkbox/react-native-checkbox","owner":"react-native-checkbox","description":"Checkbox component for React Native","archived":false,"fork":false,"pushed_at":"2023-10-20T01:04:06.000Z","size":1536,"stargazers_count":372,"open_issues_count":53,"forks_count":84,"subscribers_count":6,"default_branch":"develop","last_synced_at":"2024-05-01T15:00:05.551Z","etag":null,"topics":["checkbox","react-native"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/react-native-checkbox.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-06T17:44:24.000Z","updated_at":"2024-06-18T12:30:17.622Z","dependencies_parsed_at":"2024-06-18T12:29:40.685Z","dependency_job_id":null,"html_url":"https://github.com/react-native-checkbox/react-native-checkbox","commit_stats":{"total_commits":213,"total_committers":36,"mean_commits":5.916666666666667,"dds":"0.45539906103286387","last_synced_commit":"78077c2d65c20f4e2a237efd5dd39cc4402a905b"},"previous_names":["react-native-community/react-native-checkbox"],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-native-checkbox%2Freact-native-checkbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-native-checkbox%2Freact-native-checkbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-native-checkbox%2Freact-native-checkbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-native-checkbox%2Freact-native-checkbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/react-native-checkbox","download_url":"https://codeload.github.com/react-native-checkbox/react-native-checkbox/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238452500,"owners_count":19474946,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["checkbox","react-native"],"created_at":"2024-11-06T12:51:43.303Z","updated_at":"2025-04-08T21:30:31.877Z","avatar_url":"https://github.com/react-native-checkbox.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# `@react-native-community/checkbox`\n[![React Native Checkbox CI](https://github.com/react-native-checkbox/react-native-checkbox/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/react-native-checkbox/react-native-checkbox/actions/workflows/ci.yml)\n![Supports Android, iOS and Windows](https://img.shields.io/badge/platforms-android%20%7C%20ios%20%7C%20windows-lightgrey.svg) ![MIT License](https://img.shields.io/npm/l/@react-native-community/checkbox.svg) [![npm version](https://img.shields.io/npm/v/@react-native-community/checkbox.svg?style=flat)](https://www.npmjs.com/package/@react-native-community/checkbox) [![Lean Core Extracted](https://img.shields.io/badge/Lean%20Core-Extracted-brightgreen.svg)](https://github.com/facebook/react-native/issues/23313)\n\nReact Native component for Checkbox\n\nAndroid Example             |  IOS Example | Windows Example             |\n:-------------------------:|:-------------------------: | :-------------------------:\n\u003cimg src=\"screenShots/demo-android.png\" width=\"320\"/\u003e  |  \u003cimg src=\"screenShots/demo-ios.png\" width=\"320\"/\u003e | \u003cimg src=\"screenShots/demo-windows.png\" width=\"520\"/\u003e\n\n\n\n## Support\n\n| RN version     | Checkbox version      |\n| --------       | ----------------      |\n| \u003e 0.60 \u0026 \u003c 0.62   |  \u003e= 0.3 (Support IOS from 0.4) |\n| \u003c 0.60         |  0.2 (only Android)   |\n| \u003e= 0.62 to run on Windows | 0.5        |\n\n## Getting started\n\n`yarn add @react-native-community/checkbox`\n\nor\n\n`npm install @react-native-community/checkbox --save`\n\nOn iOS, install cocoapods:\n\n`npx pod-install`\n\nOn Windows with RNW 62 or earlier, you need to [`manually link the module`](###Manual-installation) (on RNW 63 and later autolinking will work).\n\n### Mostly automatic installation\n\nFrom react-native \u003e= 0.60 autolinking will take care of the link (on iOS and Android)\n\nfor react-native =\u003c 0.59.X\n\n`react-native link @react-native-community/checkbox`\n\n### Manual installation\n\n\u003cdetails\u003e\n\u003csummary\u003eManually link the library on Android\u003c/summary\u003e\n\n#### `android/settings.gradle`\n```groovy\ninclude ':react-native-community-checkbox'\nproject(':react-native-community-checkbox').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/checkbox/android')\n```\n\n#### `android/app/build.gradle`\n```groovy\ndependencies {\n   ...\n   implementation project(':react-native-community-checkbox')\n}\n```\n\n#### `android/app/src/main/.../MainApplication.java`\nOn top, where imports are:\n\n```java\nimport com.reactnativecommunity.checkbox.ReactCheckBoxPackage;\n```\n\nAdd the `checkbox` class to your list of exported packages.\n\n```java\n@Override\nprotected List\u003cReactPackage\u003e getPackages() {\n    return Arrays.asList(\n            new MainReactPackage(),\n            new ReactCheckBoxPackage()\n    );\n}\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eManually link the library on Windows\u003c/summary\u003e\n\n#### Add the CheckboxWindows project to your solution\n\n1. Open the solution in Visual Studio 2019.\n2. Right-click solution icon in Solution Explorer \u003e Add \u003e Existing Project.\n   Select 'D:\\pathToYourApp\\node_modules\\@react-native-community\\checkbox\\windows\\CheckboxWindows\\CheckboxWindows.vcxproj'.\n\n#### **windows/myapp.sln**\n\nAdd a reference to `CheckboxWindows` to your main application project. From Visual Studio 2019:\n\nRight-click main application project \u003e Add \u003e Reference...\nCheck 'CheckboxWindows' from the 'Project \u003e Solution' tab on the left.\n\n#### **pch.h**\n\nAdd `#include \"winrt/CheckboxWindows.h\"`.\n\n#### **app.cpp**\n\nAdd `PackageProviders().Append(winrt::CheckboxWindows::ReactPackageProvider());` before `InitializeComponent();`.\n\n\u003c/details\u003e\n\n## Migrating from the core `react-native` module\nThis 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:\n\n```javascript\nimport { CheckBox } from 'react-native';\n```\n\nto:\n\n```javascript\nimport CheckBox from '@react-native-community/checkbox';\n```\n\n## Usage\n\n### Example\n\n```javascript\nimport CheckBox from '@react-native-community/checkbox';\n```\n\n```javascript\n  const [toggleCheckBox, setToggleCheckBox] = useState(false)\n\n  \u003cCheckBox\n    disabled={false}\n    value={toggleCheckBox}\n    onValueChange={(newValue) =\u003e setToggleCheckBox(newValue)}\n  /\u003e\n```\n\nCheck out the [example project](example) for more examples.\n\n### Props\n\n## Common Props\n\n[View props...](https://reactnative.dev/docs/view#props)\n\n| Prop name     | Type     | Description                                                                                                                                                                                                           |\n| ------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| onChange      | function | Invoked on change with the native event.                                                                                                                                                                              |\n| onValueChange | function | Invoked with the new boolean value when it changes.                                                                                                                                                                   |\n| value         | boolean  | The value of the checkbox. If true the checkbox will be turned on. Default value is false.                                                                                                                            |\n| testID        | string   | Used to locate this view in end-to-end tests.\n| disabled      | boolean | If true the user won't be able to toggle the checkbox. Default value is false.\n\n\n## Android Only Props\n\n| Prop name     | Type    | Description                                                                                                                                                                                                           |\n| ------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------                                                                                                             |\n| tintColors    | object  | 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. |\n\n## IOS Only Props\n\n| Prop name     | Type    | Description                                                                                                                                                                                                           |\n| ------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| lineWidth     | number | The width of the lines of the check mark and box. Defaults to 2.0.                                                                                                                                        |\n| hideBox       | boolean | Control if the box should be hidden or not. Defaults to false |\n| boxType       | 'circle' or 'square' |  The type of box to use. Defaults to 'circle' |\n| tintColor     | string  | The color of the box when the checkbox is Off. Defaults to '#aaaaaa' |\n| onCheckColor  | string  | The color of the check mark when it is On. Defaults to '#007aff' |\n| onFillColor   | string  | The color of the inside of the box when it is On. Defaults to transparent |\n| onTintColor   | string  | The color of the line around the box when it is On. Defaults to '#007aff' |\n| animationDuration   | number  | The duration in seconds of the animations. Defaults to 0.5 |\n| 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' |\n| 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'|\n\n## Windows Props\nImplemented most of iOS and Android props.\nDefaults for color styling can be referenced here:\nhttps://docs.microsoft.com/en-us/dotnet/framework/wpf/controls/checkbox-styles-and-templates\n\n| Prop name     | Type    | Description                                                                                                                                                                                                           |\n| ------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| disabled      | boolean | If true the user won't be able to toggle the checkbox. Default value is false.                                                                                                                                                                                           |\n| tintColor     | string  | The color of the box when the checkbox is Off.|\n| onCheckColor  | string  | The color of the check mark when it is On. |\n| onFillColor   | string  | The color of the inside of the box when it is On. |\n| onTintColor   | string  | The color of the line around the box when it is On. |\n\n## Contributors\n\nThis module was extracted from `react-native` core.\n\nThe implementaion of IOS version refered to [BEMCheckBox](https://github.com/Boris-Em/BEMCheckBox)\n\n## License\nThe library is released under the MIT licence. For more information see `LICENSE`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freact-native-checkbox%2Freact-native-checkbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freact-native-checkbox%2Freact-native-checkbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freact-native-checkbox%2Freact-native-checkbox/lists"}