Socket
Socket
Sign inDemoInstall

react-radio-buttons

Package Overview
Dependencies
21
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-radio-buttons

Well-designed radio buttons for react.


Version published
Weekly downloads
2.4K
increased by13.77%
Maintainers
1
Install size
8.70 MB
Created
Weekly downloads
 

Readme

Source

react-radio-buttons

Well-designed radio buttons for react

Installation

npm install react-radio-buttons --save

Then just add import { RadioGroup, RadioButton } from 'react-radio-buttons'; into your file.

Screenshot

Usage

This is your average radio group:

<form>
  <input type="radio" name="fruit" value="apple" />Apple
  <input type="radio" name="fruit" value="orange" />Orange
  <input type="radio" name="fruit" value="melon" />Melon
</form>

By using react-radio-buttons, you can write like this (full example here) :

<RadioGroup onChange={ this.onChange } horizontal>
  <RadioButton value="apple">
    Apple
  </RadioButton>
  <RadioButton value="orange">
    Orange
  </RadioButton>
  <RadioButton value="melon">
    Melon
  </RadioButton>
  <ReversedRadioButton value="melon">
    Melon
  </ReversedRadioButton>
</RadioGroup>

API

RadioGroup

namedescription
onChangecalled when select child RadioButton
valueinitial selected value, omit for no selection and set to '' for first enabled control
horizontalwhether to align horizontally
childrendefine your RadioButtons

RadioButton

namedescription
iconSizesize of RadioIcon, which appears on the right side of button
iconInnerSizesize of RadioIcon's inner icon when selected, proper value is same as iconSize or half of iconSize
paddingpadding size
rootColorcolor when unselected
pointColorcolor when selected
valuereturn value when selected
childrenprefer string
disabledboolean flag that allows you to disable a certain a button
disabledColorcolor when disabled, including the RadioIcon

Author

InJung Chung / @mu29

License

MIT

Keywords

FAQs

Last updated on 19 Apr 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc