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>
Name | Type | Default | Description |
---|---|---|---|
options | array | [] | Specify the select(Dropdown) component options as an array of values. For example ['option 1', 'options 2', option 3'] |
defaultSelected | string | null | Specify one option from the options array as default selected option if required. |
onChange | function | selected value | This is a call-back function which returns the selected value back on onChange . |
Example
Component { console } { return <div> <h1>react-simple-radio-button Demo</h1> <ReactRadioGroup defaultSelected = 'Option 3' onChange=thisonOptionSelect options='Option 1''Option 2''Option 3' /> </div> }
License
MIT