Socket
Book a DemoInstallSign in
Socket

react-native-radio-input

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-radio-input

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

0.9.4
latest
Source
npmnpm
Version published
Weekly downloads
25
13.64%
Maintainers
1
Weekly downloads
 
Created
Source

react-native-radio-input

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

sample sample2

  • Installation
  • Examples
  • License #Installation
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

propProptypeRequiredDefaultExamples
getCheckedFunctionYesnull 1. getChecked=(value)=>{console.log(value)}
2. function getChecked(value){console.log(value)}
RadioGroupStyleReact Native View StyleNonullRadioGroupStyle={{flexDirection:"row"}}
RadioStyleReact Native View StyleNonullRadioStyle={{backgroundColor:"yellow"}}
IconStyleReact Native Text StyleNonullIconStyle={{fontSize:12}}
labelStyleReact Native Text StyleNonulllabelStyle={{fontSize:12}}
coreStyleReact Native Text StyleNonullcoreStyle={{fontSize:12}}
getChecked - function to receive the selected value - usage - See [Basic](#Basic) - (Required) RadioGroupStyle - React Native View Style RadioStyle - React Native View Style IconStyle - React Native Text Style labelStyle - React Native Text Style coreStyle - React Native Text Style

#####Radio

propProptypeRequiredDefaultExamples
iconGroupStringNoMaterialIconsiconGroup = {"MaterialIcons"}
iconNameStringNolensiconName = {"lens"}
labelStringYesnulllabel = {"This is item 1"}
valueString or numberYesnullvalue = {"A"}
iconGroup - based on react-native-vector-icons v4.6.0 by [@oblador](https://oblador.github.io/react-native-vector-icons) . All the icon groups are supported. Default is "MaterialIcons".

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

Keywords

react-component

FAQs

Package last updated on 09 Jul 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.