Skip to content

abhay2152/radio-button-react-native

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

radio-button-react-native

Simple Radio Button component for React Native

Demo

alt tag

Installation

in Cli

npm i radio-button-react-native --save

Getting started

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

export default class Example extends Component {
constructor (props){
    super(props)
      this.state = {
            value: 0
        }
    
}


handleOnPress(value){
    this.setState({value:value})
}

render(){
    return(
        <View>
        <RadioButton currentValue={this.state.value} value={0} onPress={this.handleOnPress.bind(this)}/>
         <RadioButton currentValue={this.state.value} value={1} onPress={this.handleOnPress.bind(this)}/>
         <RadioButton currentValue={this.state.value} value={2} onPress={this.handleOnPress.bind(this)}/>
        </View>
    );
}

Basic

<RadioButton
currentValue={this.state.value}
 value={0}
 onPress={this.handleOnPress.bind(this)}
 outerCircleColor:'gray'
 outerCircleSize:{24}
 outerCircleWidth:{2}
 innerCircleColor:'red'
 innerCircleSize:{12}
/>

assign a unique value to each radio button in 'value'

Props

RadioButton Component

outerCircleSize[Default:{24}]

give the size of outer Circle of Button.

outerCircleWidth[Default:{2}]

give the width of outer Circle of Button.

outerCircleColor[Default:'#9eacb4']

give the color of outer Circle of Button.

innerCircleSize[Default:{12}]

give the size of inner Circle of Button

innerCircleColor[Default:'#ff6624']

give the color of inner Circle.

About

A simple radio button component for React native.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published