0.9.4 • Published 6 years ago

react-native-radio-input v0.9.4

Weekly downloads
61
License
Apache-2.0
Repository
github
Last release
6 years ago

react-native-radio-input

A pure react, easy to use and highly customizable radio group. As easy as html radio.

sample sample2

yarn add react-native-radio-input --save
yarn add react-native-vector-icons --save
react-native link

#Examples ##Basic

import RadioGroup,{Radio} from "react-native-radio-input";

...
getChecked = (value) => {
    // value = our checked value
    console.log(value)
  }
...
<RadioGroup getChecked={this.getChecked}>
    <Radio iconName={"lens"} label={"The first option"} value={"A"}/>
    <Radio iconName={"lens"} label={"The first option"} value={"B"}/>
    <Radio iconName={"lens"} label={"I need numbers"} value={1}/>
    <Radio label={"Is IconName Optional?"} value={"Yes"}/>
    <Radio label={"Show Sentence Value"} value={"This is a Sentence"}/>
</RadioGroup>
...

###Moderate-To-Advanced You can add styles, see the props

...
getChecked = (value) => {
    // value = our checked value
    console.log(value)
  }
...
<RadioGroup getChecked={this.getChecked} RadioGroupStyle={{flexDirection: "row" }}>
    <Radio iconName={"lens"} label={"The first option"} value={"A"} />
    <Radio iconName={"lens"} label={"The first option"} value={"B"}/>
    <Radio iconName={"lens"} label={"I need numbers"} value={1}/>
    <Radio label={"Is IconName Optional?"} value={"Yes"}/>
    <Radio label={"Show Sentence Value"} value={"This is a Sentence"}/>
</RadioGroup>
...

####Styling Style the radio group, radio button, the label, and the core of the button.

####Icons The core of the button is made of icons from react-native-vector-icons

##Props

######Radio Group

#####Radio

iconName - Any icon from the iconGroup mentioned. Default is "lens" - (Required).

label - Label that needs to be displayed by or under the radio button,

value - The return value for the radio button. (Required)

License

Apache 2.0