react-native-checkbox
Cross-platform React Native checkbox component with native Fabric views for Android, iOS, and Windows.
Repository Health
Technical Analysis
@react-native-community/checkbox is the community-maintained checkbox component extracted from React Native core after the Lean Core initiative removed built-in CheckBox support. It renders a native boolean input on Android, iOS, and Windows through dedicated native view managers, giving each platform its authentic checkbox look and feel rather than a JS-drawn approximation.
The library ships full support for React Native’s New Architecture, running as a native Fabric component on Android and Windows and through the New Architecture interop layer on iOS, with a full Fabric migration for iOS tracked upstream. It exposes a small, controlled-component API (value / onValueChange) alongside platform-specific styling props like tintColors on Android and boxType, onAnimationType, and color props on iOS, making it a drop-in replacement for the deprecated core CheckBox with more customization per platform.
What You Get
- Native checkbox rendering per platform — a real Android compound-button-based checkbox, an iOS custom-drawn control, and a native Windows checkbox built on WinRT/C++
- New Architecture support — a Fabric component on Android and Windows, with a TurboModule-backed interop layer on iOS
- Controlled component API with
value/onValueChange, matching the pattern of the original core React NativeCheckBox - Per-platform customization props —
tintColorson Android;boxType,lineWidth,onAnimationType/offAnimationType, and color props on iOS - TypeScript type definitions for the component and its native module specs, plus a bundled example app covering Android, iOS, and Windows
Common Use Cases
- Replacing the deprecated core
react-nativeCheckBoxafter upgrading past the version where it was removed from core - Building settings screens and forms that need a native-feeling boolean toggle instead of a JS-rendered switch
- Cross-platform apps (including Windows via react-native-windows) that need one checkbox API instead of separate per-platform custom controls
- Terms-of-service and consent checkboxes in onboarding or checkout flows where native tap feedback and accessibility semantics matter
Under The Hood
Architecture
The repo is a Yarn workspace monorepo with the publishable package under src/ and a runnable demo under example/. The JS layer resolves per-platform implementations through React Native’s .android.tsx/.ios.tsx/.windows.tsx file-extension convention, with CheckBox.ts re-exporting whichever variant the bundler picks; each variant is a controlled class component that uses a setAndForwardRef helper to forward native refs while still tracking its own native ref internally. Actual rendering is delegated to per-platform native view managers — AndroidCheckBoxNativeComponent/ReactCheckBox+ReactCheckBoxManager (Java) on Android, RNCCheckbox/RNCCheckboxManager (Objective-C) on iOS, and a dedicated Checkbox WinRT/C++ project on Windows — so the JS side stays a thin prop-marshaling layer over native controls rather than drawing anything itself.
Tech Stack
The package targets TypeScript 5.7 with React 19 and react-native 0.82 as peer dependencies, plus an optional peer on react-native-windows 0.82 for Windows support. It builds via tsc into a dist/js output, tests with Jest, @testing-library/react-native, and the @rnx-kit/jest-preset, and lints with ESLint 9’s flat config layered with typescript-eslint and Prettier integration. End-to-end coverage runs through Detox against built Android and iOS binaries. Native builds use CocoaPods on iOS (via an RNCCheckbox.podspec), Gradle on Android, and an MSBuild solution on Windows.
Code Quality
Unit tests exist for both the base and iOS-controlled behavior (CheckBox.test.tsx, CheckBox.ios.controlled.test.tsx) backed by Jest snapshots, and CI (GitHub Actions) runs coverage, a tsc --noEmit type check, ESLint, and a full build across two Node versions with concurrency cancellation on new pushes. Typing is close to strict throughout, including codegen’d TurboModule spec interfaces, though the ESLint config explicitly relaxes a handful of rules (no-explicit-any, ban-ts-comment, no-require-imports) for native-interop code, each with an inline justification comment. There is no CONTRIBUTING document or dedicated docs directory beyond the README.
What Makes It Unique Unlike most third-party checkbox implementations that render entirely in JS, this component delegates to genuine native controls on every supported platform and keeps pace with React Native’s New Architecture rollout — it already runs as a Fabric component on Android and Windows, with iOS following via the interop layer. Windows support in particular is unusual among community RN UI primitives, giving it parity with react-native-windows apps that most equivalents ignore.