# react-radio-buttons

> Well-designed radio buttons for react.

Latest version **1.2.2** (published 2018-04-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-radio-buttons
pnpm add react-radio-buttons
yarn add react-radio-buttons
bun add react-radio-buttons
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.2 |
| Published | 2018-04-19 |
| First published | 2016-10-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 3.5 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 74 |
| Author | InJung Chung |
| Maintainers | mu29 |
| Keywords | facebook, react, radio, radio-group, radio-button, component, react-component |

## Links

- npm: https://www.npmjs.com/package/react-radio-buttons
- Repository: https://github.com/mu29/react-radio-buttons
- Homepage: https://github.com/mu29/react-radio-buttons#readme
- Issues: https://github.com/mu29/react-radio-buttons/issues
- npm.io page: https://npm.io/package/react-radio-buttons

## Dependencies (3)

- [react](https://npm.io/package/react.md) ^15.6.1
- [react-dom](https://npm.io/package/react-dom.md) ^15.3.2
- [prop-types](https://npm.io/package/prop-types.md) ^15.5.10

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.2.2 (latest) — 2018-04-19
- 1.2.1 — 2017-12-11
- 1.2.0 — 2017-11-03
- 1.1.1 — 2017-06-20
- 1.0.12 — 2017-06-15
- 1.0.11 — 2017-06-02
- 1.0.10 — 2017-03-21
- 1.1.0 — 2017-03-10
- 1.0.9 — 2016-11-17
- 1.0.8 — 2016-10-13
- 1.0.7 — 2016-10-12
- 1.0.6 — 2016-10-12
- 1.0.5 — 2016-10-12
- 1.0.4 — 2016-10-12
- 1.0.3 — 2016-10-12
- … 3 more at https://npm.io/package/react-radio-buttons/versions

## README

# 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
<img src="https://raw.githubusercontent.com/mu29/react-radio-button/master/example/example.png" width="400" />

## 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](https://github.com/mu29/react-radio-buttons/blob/master/example/example.js)) :
```
<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
| name     | description    |
|----------|----------------|
|onChange|called when select child `RadioButton`|
|value|initial selected value, omit for no selection and set to `''` for first enabled control|
|horizontal|whether to align horizontally|
|children|define your `RadioButton`s|

### RadioButton
| name     | description    |
|----------|----------------|
|iconSize|size of `RadioIcon`, which appears on the right side of button|
|iconInnerSize|size of `RadioIcon`'s inner icon when selected, **proper value is same as iconSize or half of iconSize**|
|padding|padding size|
|rootColor|color when unselected|
|pointColor|color when selected|
|value|return value when selected|
|children|prefer string|
|disabled|boolean flag that allows you to disable a certain a button|
|disabledColor|color when disabled, including the `RadioIcon`|

## Author

InJung Chung / [@mu29](http://mu29.github.io/)

## License

[MIT](./LICENSE)

---
_Source: https://npm.io/package/react-radio-buttons · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
