# react-native-radio-button

> Just a simple radio button

Latest version **2.0.1** (published 2017-09-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-radio-button
pnpm add react-native-radio-button
yarn add react-native-radio-button
bun add react-native-radio-button
```

## 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 | 2.0.1 |
| Published | 2017-09-29 |
| First published | 2016-07-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 49 |
| Author | Mazzarolo Matteo |
| Maintainers | mmazzarolo |
| Keywords | radio-button, react, react-component, react-native |

## Links

- npm: https://www.npmjs.com/package/react-native-radio-button
- Repository: https://github.com/mmazzarolo/react-native-radio-button
- Issues: https://github.com/mmazzarolo/react-native-radio-button/issues
- npm.io page: https://npm.io/package/react-native-radio-button

## Dependencies (2)

- [prop-types](https://npm.io/package/prop-types.md) ^15.5.10
- [react-native-animatable](https://npm.io/package/react-native-animatable.md) ^1.2.4

## 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

- 2.0.1 (latest) — 2017-09-29
- 1.0.2 — 2016-07-12
- 1.0.0 — 2016-07-12

## README

# React-Native Radio Button
Just a simple radio button for React-Native.  

![](https://raw.githubusercontent.com/mmazzarolo/react-native-tips/master/imgs/radio-button.gif)

### Install it with NPM...
- Run `npm install --save react-native-radio-button` 
- Require it with `import RadioButton from 'react-native-radio-button'`
<br />

### ...or just copy it in your project
You can just copy `RadioButton.js` in your project and use it directly (`react-native-animatable` is required to make it work this way).    
<br />

### Usage
Not much to say here, the component itself is just presentational: you must handle the logic outside of it:
```javascript
<RadioButton
  animation={'bounceIn'}
  isSelected={true}
  onPress={() => doSomething('hello')}
/>
```
<br />

### Available props
| Prop | Description | Default |
|---|---|---|
|**`size`**|Size of the Radio Button. |`16`|
|**`innerColor`**|Color of the inner circle. |`dodgerblue`|
|**`outerColor`**|Color of the outer circle. |`dodgerblue`|
|**`isSelected`**|Is this Radio Button selected? |`false`|
|**`onPress`**|Function invoked on button press. |*None*|

The Radio Button is animated by the awesome [`react-native-animatable`](https://github.com/oblador/react-native-animatable).  
To enable the animation you can just pass it any `react-native-animatable` props (e.g. `animation`, `duration`, etc...).  
Hint: `animation={'bounceIn'}` is the animation that you can see in the preview gif above.
<br />

### Stateless component info
As you can see by taking a look at `RadioButton.js` the component is plain simple and you can modify it easily.  
If you're interested there's also a version of it written in a more function style [here](https://gist.github.com/mmazzarolo/3ed3883d5c838c7010c353c6f3ac2be8).

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