react-native-custom-radio-button
Simple and animated radio button component for React Native
Demo
Installation
npm i react-native-custom-radio-button --save
Getting started
Basic
{ this} { return <View style=stylescontainer> <RadioGroup onSelect = this > <RadioButton value='React native'> <Text style=stylestitle>React native</Text> </RadioButton> <RadioButton value='Javascript'> <Text style=stylestitle>Javascript</Text> </RadioButton> <RadioButton value='Flexbox'> <Text style=stylestitle>Flexbox</Text> </RadioButton> </RadioGroup> <Text style=stylestext>thisstatetext</Text> </View> }
Custom
<RadioGroup size=24 thickness=2 selectedIndex=1 onSelect = this > <RadioButton value='Red color' color='red'> <Text style=stylestitle>Red color</Text> </RadioButton> <RadioButton value='Green color' color='green'> <Text style=stylestitle>Green color</Text> </RadioButton> <RadioButton value='Blue color' color='blue'> <Text style=stylestitle>Blue color</Text> </RadioButton> </RadioGroup>
Configuration
Radio Group:
Property | Type | Default | Description |
---|---|---|---|
size | number | 20 | radio button size |
thickness | number | 1 | radio button border width |
color | string | '#007AFF' | radio button color |
highlightColor | string | null | selected radio button background |
selectedIndex | number | null | default selected index of radio group |
onSelect | function(index, value) | null | function to be invoked when radio button is selected |
Contributing
Of course! Welcome :)
You can use following command in example
dir: