@futurejj/react-native-checkbox

中文文档
1.0.10发布于 2026/10/25MITTypeScriptCommonJS零依赖构建来源已验证近 30 天下载 7.1万

A papery checkbox for react native

原始使用文档
文档目录14 节
  1. Features
  2. Installation
  3. Icon Dependencies
  4. Usage
  5. Basic Example
  6. Customization
  7. API Reference
  8. Props
  9. Animation
  10. Accessibility
  11. Contributing
  12. License
  13. 🙏 Support the project
  14. ❤️ Thanks to

@futurejj/react-native-checkbox

A papery checkbox for react native

npm version GitHub license Workflow Status Android iOS Web GitHub issues TS Expo Snack npm bundle size Sponsor

A beautiful, customizable, and animated checkbox component for React Native applications. This component works across iOS, Android, and Web platforms with smooth animations and accessibility support.

React Native Animated Checkbox Demo

Features

  • ✨ Beautiful animations on state changes
  • 🎨 Fully customizable colors and styling
  • 📱 Cross-platform (iOS, Android, Web)
  • 🔄 Three states: checked, unchecked, and indeterminate
  • ♿ Accessibility support built-in
  • 📏 Customizable size for various design needs
  • 🔌 Works with Expo and standard React Native
  • 🔍 TypeScript support with full type definitions

Installation

yarn add @futurejj/react-native-checkbox
# or
npm install @futurejj/react-native-checkbox

Icon Dependencies

This component uses Material Community Icons. You'll need to install either:

  • @expo/vector-icons (if using Expo - built-in)
  • react-native-vector-icons (if using React Native CLI - follow the installation instructions for react-native-vector-icons)

Usage

Basic Example

import React, { useState } from 'react';
import { View } from 'react-native';
import { Checkbox } from '@futurejj/react-native-checkbox';

export default function CheckboxExample() {
  const [checked, setChecked] = useState(false);

  const toggleCheckbox = () => {
    setChecked(!checked);
  };

  return (
    <View style={{ padding: 20 }}>
      <Checkbox
        status={checked ? 'checked' : 'unchecked'}
        onPress={toggleCheckbox}
      />
    </View>
  );
}

Customization

<Checkbox
  status="checked" // 'checked', 'unchecked', or 'indeterminate'
  disabled={false} // disable the checkbox
  onPress={() => {}} // handle press events
  color="#6200ee" // color when checked
  uncheckedColor="#757575" // color when unchecked
  size={32} // customize size (default: 24)
  style={{ marginRight: 8 }} // additional styles for the container
/>

API Reference

Props

PropTypeDefaultDescription
status'checked' OR 'unchecked' OR 'indeterminate'RequiredCurrent status of the checkbox
disabledbooleanfalseWhether the checkbox is disabled
onPress(e: GestureResponderEvent) => voidRequiredCallback when checkbox is pressed
colorstring'#2196F3'Color of the checkbox when checked
uncheckedColorstring'#757575'Color of the checkbox when unchecked
sizenumber24Size of the checkbox icon
testIDstring-Test ID for testing frameworks
styleStyleProp<ViewStyle>-Additional styles for container

Animation

The checkbox includes smooth animations:

  • Scale animation when transitioning between states
  • Custom border animation for a more engaging interaction

Accessibility

This component is built with accessibility in mind:

  • Proper role assignment (checkbox)
  • Correct states reported to screen readers
  • Live region updates for dynamic changes

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


🙏 Support the project

LiberPay_Donation_Button           Paypal_Donation_Button           Paypal_Donation_Button

❤️ Thanks to

版本与发布记录

@futurejj/react-native-checkbox 共发布 14 个版本,首次发布于 2025/05/10;过去 12 个月发布了 5 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.0.10latest2026/10/2521 天前
1.0.92026/09/062 个月前
1.0.82026/08/182 个月前
1.0.72026/04/047 个月前
1.0.62026/02/089 个月前
1.0.52025/08/151.3 年前

关于 @futurejj/react-native-checkbox 的常见问题

@futurejj/react-native-checkbox 是什么?

A papery checkbox for react native

如何安装 @futurejj/react-native-checkbox?

在项目目录运行 npm install @futurejj/react-native-checkbox,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(*)、react-native(*)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@futurejj/react-native-checkbox 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@futurejj/react-native-checkbox 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@futurejj/react-native-checkbox 可以商用吗?

@futurejj/react-native-checkbox 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@futurejj/react-native-checkbox 的下载量有多少?

根据 npm 官方下载统计,@futurejj/react-native-checkbox 在 2026/10/16 – 2026/11/14 这 30 天内被下载 70,522 次,日均约 2,351 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@futurejj/react-native-checkbox 还在维护吗?

最新版本 1.0.10 发布于 2026/10/25(21 天前);至今共发布 14 个版本,其中过去 12 个月发布了 5 个;首次发布于 2025/05/10。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。