This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.
This is documentation for the next SDK version. For up-to-date documentation, see the latest version (SDK 57).
Checkbox
A toggle control that represents a checked or unchecked state.
A controlled checkbox. Pair value with onValueChange to manage state from React.
Installation
- npx expo install @expo/uiIf you are installing this in an existing React Native app, make sure to install expo in your project.
Usage
Basic checkbox
import { useState } from 'react'; import { Host, Checkbox } from '@expo/ui'; export default function CheckboxExample() { const [accepted, setAccepted] = useState(false); return ( <Host matchContents> <Checkbox label="I accept the terms" value={accepted} onValueChange={setAccepted} /> </Host> ); }
Disabled
import { Host, Checkbox } from '@expo/ui'; export default function DisabledCheckboxExample() { return ( <Host matchContents> <Checkbox label="Locked option" value onValueChange={() => {}} disabled /> </Host> ); }
API
import { Checkbox } from '@expo/ui';
Component
Type: React.Element<CheckboxProps>
A toggle control that represents a checked or unchecked state.
Props for the Checkbox component.
booleanWhether the checkbox is disabled. Disabled checkboxes do not respond to user interaction.
ModifierConfig[]Platform-specific modifier escape hatch. Pass an array of modifier configs
from @expo/ui/swift-ui/modifiers or @expo/ui/jetpack-compose/modifiers.
stringIdentifier used to locate the component in end-to-end tests.