WrathChaos / react-native-bouncy-checkbox

Fully customizable animated bouncy checkbox for React Native
https://freakycoder.com
MIT License
777 stars 60 forks source link

Color of checked icon #107

Closed teckbeng-payboy closed 2 years ago

teckbeng-payboy commented 2 years ago

May I know is there any props for me to change the color of checked icon? This is due to the background color of my checkbox will be white in color

WrathChaos commented 2 years ago

Hello @teckbeng-payboy You can override the default icon style with iconImageStyle prop. So you can use tintColor to change the icon's color.

OR

you can use iconComponent prop to set your own icon component as you wish.

Something like this:

<BouncyCheckbox 
   iconComponent={<Image source={} style={} />}
   onPress={(isChecked: boolean) => {}} 
/>
teckbeng-payboy commented 2 years ago

I'm sorry, is there iconImageStyle prop?

You mean like this

<BouncyCheckbox iconImageStyle={styles.xxx} onPress={(isChecked: boolean) => {}} />

WrathChaos commented 2 years ago

Yes, there is an iconImageStyle prop which you can customize the icon image itself.

https://github.com/WrathChaos/react-native-bouncy-checkbox/blob/6748d32a5cde7ec4e59d38fc9b9f7f4d3113952e/lib/BouncyCheckbox.tsx#L125