Socket
Socket
Sign inDemoInstall

react-native-simple-radio-button-input

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-native-simple-radio-button-input

simple radio button component for React Native


Version published
Weekly downloads
11
increased by37.5%
Maintainers
1
Install size
3.22 kB
Created
Weekly downloads
 

Readme

Source

React Native Simple Radio Button

How to install ?

npm i react-native-simple-radio-button-input

or

yarn add react-native-simple-radio-button-input

React Native Radio Button

Example

import RadioButton from 'react-native-simple-radio-button-input';

<RadioButton 
    color={'red'}
    selected={true}
    onPress={()=>{})}
/>

Complete Example

import React, { Component } from 'react';
import { View, Text } from 'react-native';
import RadioButton from 'react-native-simple-radio-button-input';

const DATA = ['Student', 'Teacher'];

export default class index extends Component {
  constructor(props) {
    super(props);
    this.state = {
        selected:null
    };
  }

  render() {
    return (
      <View style={{flex:1, justifyContent:'center', padding:15}}>

        {DATA.map(val=>(
        <View style={{flexDirection:'row', marginBottom:15, alignItems:'center'}}>
          <RadioButton 
              color={'blue'}
              selected={this.state.selected==val}
              onPress={()=>{this.setState({
                      selected: val
                  })
              }}
          />
            <Text style={{marginLeft:7}}> {val} </Text>
          </View>
        ))}

      </View>
    );
  }
}


FAQs

Last updated on 27 Jan 2020

Did you know?

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc