import React, {Component} from 'react'; import {StyleSheet} from 'react-native'; import {Assets, Colors, View, Text, Button, Checkbox, CheckboxRef} from 'react-native-ui-lib'; //eslint-disable-line export default class CheckboxScreen extends Component { state = { value1: false, value2: false, value3: true, value4: true, value5: false, value6: false, value7: false, validationText: '', validationColor: Colors.$textDefault }; checkbox = React.createRef(); onPress = () => { this.checkbox.current?.validate(); }; onValueChange = (value: boolean) => { this.setState({value7: value}, () => { console.log('onValueChange: ', value); }); }; onChangeValidity = (value?: boolean) => { this.setState({ validationText: String(value), validationColor: value === true ? Colors.$textSuccess : Colors.$textDangerLight }); }; render() { return ( Checkbox Customizable UI this.setState({value1})}/> this.setState({value2})} borderRadius={2} size={30} color={Colors.purple30} selectedIcon={Assets.icons.demo.x} marginL-s5 /> this.setState({value3})} borderRadius={5} size={18} color={Colors.grey10} iconColor={Colors.green10} marginL-s5 /> this.setState({value6})} containerStyle={styles.checkbox} /> this.setState({value7})} indeterminate label={'Indeterminate state'} color={Colors.green20} containerStyle={styles.checkbox} /> Disabled States this.setState({value5})} style={{marginRight: 20}} /> this.setState({value5})} iconColor={Colors.green10} /> Validation {this.state.validationText}