Skip to content

Latest commit

 

History

History
48 lines (36 loc) · 725 Bytes

README.md

File metadata and controls

48 lines (36 loc) · 725 Bytes

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 })
        }}
      />
    )
  }
}