Skip to main content

Checkbox

Checkbox control with label for boolean selections.

Basic Usage​

import { Checkbox } from '@multinaire/expo-ui';

<Checkbox
title="I agree to the terms"
value={agreed}
onChange={setAgreed}
/>

Props​

PropTypeDefaultDescription
titlestring—Label displayed next to the checkbox
valueboolean—Whether the checkbox is checked
testIDstring—Test identifier for UI automation
onChange(value: boolean) => void—Callback invoked when the checked state changes
flexnumber—Flex grow value
marginSpacingProps—Outer margin

Examples​

Basic Checkbox​

const [isChecked, setIsChecked] = useState(false);

<Checkbox
title="Enable notifications"
value={isChecked}
onChange={setIsChecked}
/>

Terms Agreement​

<Checkbox
title="I agree to the Terms of Service and Privacy Policy"
value={agreed}
onChange={setAgreed}
/>

Multiple Options​

<Container gap={8}>
<Checkbox
title="Email notifications"
value={emailNotifications}
onChange={setEmailNotifications}
/>
<Checkbox
title="Push notifications"
value={pushNotifications}
onChange={setPushNotifications}
/>
<Checkbox
title="SMS notifications"
value={smsNotifications}
onChange={setSmsNotifications}
/>
</Container>

With Margin​

<Checkbox
title="Remember me"
value={rememberMe}
onChange={setRememberMe}
margin={{ top: 16 }}
/>