/* @flow */ import * as React from 'react'; import { View, StyleSheet } from 'react-native'; import { Paragraph, Checkbox, Colors, TouchableRipple, withTheme, } from 'react-native-paper'; import type { Theme } from 'react-native-paper/types'; type Props = { theme: Theme, }; type State = { checkedNormal: boolean, checkedCustom: boolean, }; class CheckboxExample extends React.Component { static title = 'Checkbox'; state = { checkedNormal: true, checkedCustom: true, }; render() { const { theme: { colors: { background } } } = this.props; return ( this.setState(state => ({ checkedNormal: !state.checkedNormal, })) } > Normal this.setState(state => ({ checkedCustom: !state.checkedCustom, })) } > Custom Checked (Disabled) Unchecked (Disabled) ); } } const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: Colors.white, paddingVertical: 8, }, row: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', paddingVertical: 8, paddingHorizontal: 16, }, }); export default withTheme(CheckboxExample);