CheckBox

An accessible checkbox component with customizable appearance.

CheckBox is a controlled component. The onValueChange callback should be used to update the value prop to reflect user actions. If the value prop is not updated, the component will continue to render the supplied value prop instead of the expected result of any user actions.

import { CheckBox } from 'react-native-web';

<CheckBox {...props} />;

API

Props

...ViewProps ?ViewProps

All the props supported by View.

color ?string = "#AAB8C2"

Set the background color of the checkbox.

disabled ?boolean

Prevent all interactions with the checkbox.

onChange ?(e: ChangeEvent) => void

Called when the state of the native checkbox changes.

onValueChange ?(value: boolean | "mixed") => void

Called when the state of the native checkbox changes.

value ?(boolean | "mixed") = false

Set the value of the checkbox.


Examples

Note that the size of the checkbox can be controlled by changing the height and width style properties.

  For TV Examples: LRUD navigation is already enabled in this sandbox. Use your keyboard arrow keys to move focus.

Updated
React Native Web for TVPortions Copyright © Nicolas Gallagher, Meta Platforms, Inc., Facebook, Inc. and affiliates, and other contributors as noted in file headers and THIRD_PARTY_NOTICES.md. Modifications and TV extensions Copyright © Harpreet Singh and contributors.