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
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.