---
title: "Checkbox"
description: "A checkmark that draws itself in."
documentation: "https://beui.dev/react-native/checkbox"
markdown: "https://beui.dev/react-native/checkbox.md"
---

# Checkbox

> A checkmark that draws itself in.

React Native component for Expo, from beUI Native. Group: Forms. Variants: 1.

## Install

Set up beUI Native once per app first: https://beui.dev/docs/native-setup.md

```bash
npx beui-native add checkbox
```

Or copy the source by hand and install its libraries:

```bash
npx expo install react-native-reanimated react-native-worklets
npm install uniwind tailwindcss
```

## Links

- Source: https://github.com/starc007/beui-native/tree/main/src/components/checkbox
- Registry JSON with every file: https://beui.dev/native/r/checkbox
- Open in Expo Go: exp://u.expo.dev/93a3a95c-6dc2-4adb-b57c-efbecf859f25/--/checkbox?runtime-version=exposdk%3A58.0.0&channel-name=production
- Web version: https://beui.dev/components/motion/checkbox.md

## README

### Checkbox

Native port of [beUI Checkbox](https://beui.dev/components/motion/checkbox). A form choice with a checkmark that draws itself in, spring press feedback, and an indeterminate state.

```tsx
import { Checkbox } from "./src";

<Checkbox checked={accepted} onCheckedChange={setAccepted} label="Accept terms and conditions" />
<Checkbox label="Email me updates" description="One message a month." />
<Checkbox checked={all} indeterminate={some} onCheckedChange={toggleAll} label="Select all" />
```

- **Mark:** the checkmark draws itself in over 300 ms, and the indeterminate dash over 200 ms. The mark fades and scales in from 50%. When `indeterminate` turns on or off, the check and the dash crossfade.
- **Colours:** the fill and border fade between the idle and primary colours over 200 ms.
- **Press:** the box springs to 92% on beUI's `SPRING_PRESS` spring.
- **State:** pass `checked` with `onCheckedChange` to control it, or `defaultChecked` to let it manage itself. As on the web, pressing calls `onCheckedChange(!checked)`; an indeterminate checkbox decides what "select all" means through that handler.
- **Label and description:** `label` is the spoken name, and `description` is read as the accessibility hint. The box and text form one touch target, and `hitSlop` tops a 20-point row up to 48 points.
- **Accessibility:** reports the `checkbox` role. An indeterminate checkbox reports a mixed state.
- **Reduced motion:** when the system asks for it, or `disableAnimation` is set, the mark and colours change instantly with no press scale.

The mark is drawn by the shared `DrawnPath` primitive with rotated Views, matching the web SVG path, so the component needs no SVG library.

Copy this directory, `hooks/use-presence.ts`, `hooks/use-reduced-motion.ts`, `primitives/drawn-path.tsx`, `styles/motion.ts`, and the semantic tokens in `styles/theme.css`.
