I’m using CheckBox from the react-native for react-native project.
I want to change the style to the following image. But there is no specific way to change the mark inside the checkbox.
I’m not an expert UI developer to implement this style. I tried different solutions to fix this styling issue, but I still can not fix it. Please help me to find a solution for this. Thanks in advance.
Expected Checkbox UI :
available UI with my stylings:
Code and Styles as below.
import { CheckBox } from 'react-native';
<CheckBox
value={isItemSelected}
onValueChange={() => [setItemSelection(!isItemSelected),
categorySelectHandler(item.category_name, !isItemSelected)]}
style={styles.checkbox}
onFillColor={"#C4C4C4"}
color={'#FF8300'} />
checkbox: {
alignSelf: "center",
borderRadius: 10,
borderColor: '#C4C4C4',
},
2
Answers
Use @react-native-community/checkbox for customisation.
Instead of using react-native-checkbox you can create a custom checkbox component that will work in the same way. You just have to use the checked image and the uncheck image for that and wrap it inside the Pressable.
For example :
where checked and unChecked images are the one you will import.
Try this Library npm i react-native-check-box ,