Checkbox
A Checkbox component allows users to select or deselect options. Built on top of heroui-native Checkbox with isSelected/onSelectedChange API.
React Native components render to native views, so this is the component running in the example app, in the theme you are reading in.
9:41


Checkbox.tsx
import { View } from 'react-native';import { useState } from 'react';import { NCheck, NText } from '@nayan-ui/native';export default function CheckScreen() {const [a, setA] = useState(false);const [b, setB] = useState(true);return (<View className="p-4 gap-4"><NText className="text-lg font-bold">Basic</NText><NCheck label="Accept terms and conditions" isSelected={a} onSelectedChange={setA} /><NText>Checked: {a ? 'Yes' : 'No'}</NText><NText className="text-lg font-bold">Pre-checked</NText><NCheck label="Receive newsletters" isSelected={b} onSelectedChange={setB} /><NText className="text-lg font-bold">Disabled</NText><NCheck label="Disabled unchecked" isSelected={false} isDisabled onSelectedChange={() => {}} /><NCheck label="Disabled checked" isSelected isDisabled onSelectedChange={() => {}} /></View>);}
| Name | Type | Default | Details |
|---|---|---|---|
| label | string | Required | Label text for the checkbox. |
| isSelected | boolean | false | Whether the checkbox is selected. |
| isDisabled | boolean | false | Whether the checkbox is disabled. |
| onSelectedChange | (selected: boolean) => void | Optional | Callback when checkbox state changes. |
| containerClassName | string | ' ' | You can customise container by passing tailwind classes. |
| labelClassName | string | ' ' | You can customise label by passing tailwind classes. |
Other components solving nearby problems.
- React Native Checkbox
- React Native Check Component
- React Native Checkbox Group
- Mobile Checkbox React Native
- React Native Checkbox Component
- React Native Checkbox Library
- React Native Check Box
- React Native Form Checkbox
- React Native Multi Select
- React Native Checkbox List
- React Native Custom Checkbox
- React Native Boolean Checkbox
- Mobile Checkbox Component
- Cross Platform Checkbox
- Expo Checkbox Component
- React Native Checkbox Tutorial
- React Native Checkbox TypeScript
- React Native Checkbox UI