react-native-paper: Checkbox on iOS is not visible
Current behaviour
Checkbox on iOS is no visible if not checked.
Expected behaviour
Code sample
import * as React from 'react';
import { Checkbox } from 'react-native-paper';
const MyComponent = () => {
const [checked, setChecked] = React.useState(false);
return (
<Checkbox
status={checked ? 'checked' : 'unchecked'}
onPress={() => {
setChecked(!checked);
}}
/>
);
};
export default MyComponent;
Screenshots (if applicable)
Unchecked state:

Checked state:

What have you tried
Used official docs https://callstack.github.io/react-native-paper/checkbox.html
Also not style
property to checkbox?


Your Environment
software | version |
---|---|
ios or android | iOS or web case with expo |
react-native | 0.63.3 |
react-native-paper | 4.3.0 |
node | v12.16.1 |
npm or yarn | 6.13.4 |
expo sdk | 39.0.0 |
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 3
- Comments: 16
https://callstack.github.io/react-native-paper/checkbox.html
As you can see, it’s the typical behavior. You have to wrap a box or anything by yourself.
Edit: Or just use
<Checkbox.Android ... />
You can always use <Checkbox.Android /> to just use the Android properties (ie. outlined unchecked box) on iOS devices.
type mode=“android” the box will appear in ios…
This was solved for me by implementing
<Checkbox.Item>
along withmode="android"
.Example:
The thing that I was pointing to, is that it’s not a bug, it’s a well formed implementation. On iOS you should not use Checkboxes if you want to strictly fit their guidlines. Here is a example of Material Design Cross Platform Adaption, there you can see the controls guideline
Edit:
As mentioned on the material.io website