Created
June 21, 2018 03:41
-
-
Save ThakurBallary/81199e63161af079561641ddb3db0143 to your computer and use it in GitHub Desktop.
react-native-btr-demo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import { View, Text, StyleSheet } from 'react-native'; | |
import { RadioGroup } from 'react-native-btr'; | |
class RadioGroupDemo extends Component { | |
static navigationOptions = { | |
title: 'RadioGroup' | |
} | |
state = { | |
radioButtons: [ | |
{ | |
label: 'Default', | |
}, | |
{ | |
label: 'In-Progress', | |
checked: true, | |
color: '#cb8' | |
}, | |
{ | |
label: 'Completed', | |
color: '#484' | |
}, | |
] | |
} | |
render() { | |
return ( | |
<View style={styles.container}> | |
<View style={styles.card}> | |
<RadioGroup | |
labelStyle={{fontSize: 14}} | |
radioButtons={this.state.radioButtons} | |
onPress={radioButtons => this.setState({radioButtons})} | |
style={{flexDirection: 'row'}} | |
/> | |
</View> | |
</View> | |
); | |
} | |
} | |
const styles = StyleSheet.create({ | |
container: { | |
flex: 1, | |
}, | |
card: { | |
backgroundColor: '#fff', | |
borderRadius: 4, | |
margin: 20, | |
padding: 20 | |
} | |
}); | |
export default RadioGroupDemo; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment