1.0.14 • Published 7 years ago

react-simple-radio-button v1.0.14

Weekly downloads
24
License
MIT
Repository
github
Last release
7 years ago

react-simple-radio-button

Installation

npm install react-simple-radio-button --save

Features

  • React RadioButton
  • You can create radio group with n number of options
  • You can pass options as array
  • Set a default value
  • Get the selected value as string
  • Customized UI
  • Can override the styles

Usage

<ReactRadioGroup 
    options={'Option 1', 'Option 2', 'Option 3'}
    defaultSelected='Option 2'/>

Props

<ReactSingleDropdown>

NameTypeDefaultDescription
optionsarray[]Specify the select(Dropdown) component options as an array of values. For example 'option 1', 'options 2', option 3'
defaultSelectedstringnullSpecify one option from the options array as default selected option if required.
onChangefunctionselected valueThis is a call-back function which returns the selected value back on onChange.

Example

import React from 'react'

import ReactRadioGroup from 'react-simple-radio-button'

export default class Demo extends React.Component {

  onOptionSelect = (value) => {
    console.log('Selected value=', value)
  }
  
  render() {
    return <div>
      <h1>react-simple-radio-button Demo</h1>
      <ReactRadioGroup 
      defaultSelected = 'Option 3'
      onChange={this.onOptionSelect}
      options={['Option 1','Option 2','Option 3']} />
    </div>
  }
}

License

MIT

1.0.14

7 years ago

1.0.13

8 years ago

1.0.12

8 years ago

1.0.11

8 years ago

1.0.10

8 years ago

1.0.7

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.0

8 years ago