Skip to content

tsepeti/rnative-radio-buttons

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple radio button component for React Native

Installation

To install a stable release use:

yarn

yarn add rnative-radio-buttons

npm

npm i rnative-radio-buttons --save

Example

import RadioButtons from 'rnative-radio-buttons';

const options = [
  { label: 'Erkek', value: 'E' },
  { label: 'Kadın', value: 'K' },
];

class Index extends Component {
  state = {
    value: 'E'
  };
  
  render() {
    return (
      <RadioButtons
        options={options}
        selected={this.state.value}
        onPress={(value) => {
          return this.setState({ value })
        }}
      />
    )
  }
}