Simple Radio Button Component for React Native - iOS and Android
npm i rn-radio-button-group --save
or
yarn add rn-radio-button-group
<RadioGroup
onValueChange={(value) => setLangValue(value)}
selectedValue={langValue}
>
<RadioButton
value={"green"}
style={{ marginBottom:10 }}
size={27}
color="green"
>
<Text style={{ marginLeft:10, fontSize:18 }} >Green</Text>
</RadioButton>
<RadioButton
value={"red"}
style={{ marginBottom:10 }}
size={27}
color="red"
>
<Text style={{ marginLeft:10, fontSize:18 }} >Red</Text>
</RadioButton>
<RadioButton
value={"yellow"}
style={{ marginBottom:10 }}
size={27}
color="yellow"
>
<Text style={{ marginLeft:10, fontSize:18 }} >Yellow</Text>
</RadioButton>
<RadioButton
value={"orange"}
style={{ marginBottom:10 }}
size={27}
color="orange"
>
<Text style={{ marginLeft:10, fontSize:18 }} >Orange</Text>
</RadioButton>
</RadioGroup>
Key | Type | Required | Default | Valid Values |
---|---|---|---|---|
selectedValue | string | yes | string | |
onValueChange | function | yes | any function | |
children | React.ReactNode | no | React.ReactNode |
Key | Type | Required | Default | Valid Values |
---|---|---|---|---|
value | string | yes | any string | |
disabled | boolean | no | false | true |
onPress | function | no | any function with paramter one accepting parameter (value) | |
color | string | no | #900 | any color codes |
unCheckColor | string | no | color value |
any string |
size | number | no | 24 | any numeric value |
thickness | number | no | 1 | any numeric value |
style | object | no | any StyleSheet Object | |
checked | boolean | no | false | true |
children | React.ReactNode | no | React.ReactNode |
Fork and create a pull request