# react-native-radio-check

> * Support Android and IOS * Similar to RadioButton and CheckBox int Android

Latest version **1.0.1** (published 2023-02-28) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2023-02-28 |
| First published | 2021-10-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 14.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | qztbl |
| Maintainers | qztbl |
| Keywords | react-native, checkbox, radiobutton, radiogroup, android, ios, check box, radio button, radio group |

## Links

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

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2023-02-28
- 1.0.0 — 2021-10-09

## README

# react-native-radio-check

* Support Android and IOS
* Similar to RadioButton and CheckBox int Android 

## Install

`$ yarn add react-native-radio-check`

or

`$ npm install react-native-radio-check --save`

## Import

`import { CheckBox, RadioButton, RadioGroup } from "react-native-radio-check"`

## Props

#### RadioButton
| Props            | Type                  | Desc                                                         | Default   |
| :--------------- | :-------------------- | ------------------------------------------------------------ | --------- |
| style            | StyleProp<ViewStyle>  | Sets the style of button.                                    | undefined |
| icon             | RadioIcon             | Sets normal and checked icons.                               | undefined |
| iconStyle        | StyleProp<ImageStyle> | Sets the style of icon .                                     | undefined |
| text             | string                | Sets the text of button                                      | undefined |
| textStyle        | StyleProp<TextStyle>  | Sets the style of text                                       | undefined |
| textCheckedStyle | StyleProp<TextStyle>  | Sets the style of text when checked.                         | undefined |
| id               | number                | Sets the id of button, this prop needs to be used with RadioGroup. | undefined |
| value            | any                   | This prop needs to be used with RadioGroup，you can set a added value. | undefined |
| checked          | boolean               | Sets checked state of button.                                | undefined |
| disabled         | boolean               | if true, user not to tap the button.                         | undefined |
| onChecked        | function              | Handler to be called when changing checked state.            | undefined |

#### RadioGroup
| Props            | Type                  | Desc                                              | Default   |
| :--------------- | :-------------------- | ------------------------------------------------- | --------- |
| style            | StyleProp<ViewStyle>  | Sets the style of component.                      | undefined |
| icon             | RadioIcon             | Sets normal and checked icons of sub RadioButton. | undefined |
| iconStyle        | StyleProp<ImageStyle> | Sets icon style of sub RadioButton.               | undefined |
| textStyle        | StyleProp<TextStyle>  | Sets text style of sub RadioButton.               | undefined |
| textCheckedStyle | StyleProp<TextStyle>  | Sets text style of sub RadioButton when checked.  | undefined |
| checkedId        | number                | Sets the id of current checked sub RadioButton.   | undefined |
| onChecked        | function              | Handler to be called when changing checked state. | undefined |

#### CheckBox

Refer to RadioButton

## Example

```javascript
<RadioButton
  icon={{
    ormal: require('./icon/ic_normal.png'),
    checked: require("./icon/ic_radio_check.png")
   }}
   textStyle={{ marginLeft: 5 }}
   text="AA"
   onChecked={(checked, pressed) => {

   }} />

<RadioGroup
  style={{ flexDirection: 'row', marginTop: 10 }}
  checkedId={this.state.index}
  icon={{
    normal: require('./icon/ic_normal.png'),
    checked: require("./icon/ic_radio_check.png")
  }}
  textStyle={{ marginLeft: 5 }}
  onChecked={(id, value) => {
    console.info("Group===", id)
    console.info("Value===", value)
  }}>
  <RadioButton
    text="AAA"
    value={1} />
  <RadioButton
    style={{ marginLeft: 20 }}
    text="BBB"
    value={2} />
</RadioGroup>

<CheckBox
  checked={this.state.check}
  icon={{
    normal: require('./icon/ic_normal.png'),
    checked: require("./icon/ic_check.png")
  }}
  textStyle={{ marginLeft: 5 }}
  text="A"
  onChecked={(checked, pressed) => {

  }} />
```
![](./example.gif)

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