# @trendmicro/react-radio-button

> React Radio Button component

Latest version **2.0.0** (published 2017-12-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install @trendmicro/react-radio-button
pnpm add @trendmicro/react-radio-button
yarn add @trendmicro/react-radio-button
bun add @trendmicro/react-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.0 |
| Published | 2017-12-22 |
| First published | 2017-05-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 11 |
| Author | Tina C Lin |
| Maintainers | xjkit, rothpeng, cheton, trendmicro-frontend |
| Keywords | react, react-radio-button |

## Links

- npm: https://www.npmjs.com/package/@trendmicro/react-radio-button
- Repository: https://github.com/trendmicro-frontend/react-radio-button
- Issues: https://github.com/trendmicro-frontend/react-radio-button/issues
- npm.io page: https://npm.io/package/@trendmicro/react-radio-button

## Dependencies (2)

- [classnames](https://npm.io/package/classnames.md) ^2.2.5
- [prop-types](https://npm.io/package/prop-types.md) ^15.6.0

## 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.0 (latest) — 2017-12-22
- 1.0.1 — 2017-10-06
- 1.0.0 — 2017-05-10

## README

# react-radio-button [![build status](https://travis-ci.org/trendmicro-frontend/react-radio-button.svg?branch=master)](https://travis-ci.org/trendmicro-frontend/react-radio-button) [![Coverage Status](https://coveralls.io/repos/github/trendmicro-frontend/react-radio-button/badge.svg?branch=master)](https://coveralls.io/github/trendmicro-frontend/react-radio-button?branch=master)

[![NPM](https://nodei.co/npm/@trendmicro/react-radio-button.png?downloads=true&stars=true)](https://nodei.co/npm/@trendmicro/react-radio-button/)

React Radio Button

Demo: https://trendmicro-frontend.github.io/react-radio-button

## Installation

1. Install the latest version of [react](https://github.com/facebook/react) and [react-radio-button](https://github.com/trendmicro-frontend/react-radio-button):

  ```
  npm install --save react @trendmicro/react-radio-button
  ```

2. At this point you can import `@trendmicro/react-radio-button` and its styles in your application as follows:

  ```js
  import RadioButton from '@trendmicro/react-radio-button';

  // Be sure to include styles at some point, probably during your bootstraping
  import '@trendmicro/react-radio-button/dist/react-radio-button.css';
  ```

## Usage

```jsx
<RadioButton label="RadioButton label" />
```

The label prop is optional, you can use children to pass through the component.

```jsx
<RadioButton label="RadioButton label">
    <p style={{ marginLeft: 24 }}>
        Lorem ipsum dolor sit amet...
    </p>
</RadioButton>

<RadioButton>
    <span style={{ verticalAlign: 'middle', marginLeft: 8 }}>
        Lorem ipsum dolor sit amet...
    </span>
</RadioButton>
```

### Uncontrolled RadioButton

```js
// Default checked
<RadioButton defaultChecked />
```

### Controlled RadioButton

```js
// Checked
<RadioButton checked />
```

## API

### Properties

Name | Type | Default | Description
:--- | :--- | :------ | :----------
children | any | | Children to pass through the component.
className | Object | | Customized class name for the component.
style | Object | | Customized style for the component.
label | Node or String | | Text label to attach next to the radio button.
inputClassName | Object | | Customized class name for the radio button.
inputStyle | Object | | Customized style for the radio button.
disabled | Boolean | false | If true, the radio button shown as disabled and cannot be modified.
checked | Boolean | | The checked state of the radio button.
defaultChecked | Boolean | | The default checked state of the radio button.

### Class Properties

Use the ref property to get a reference to the component:

```jsx
<RadioButton
    ref={node => {
        if (node) {
            this.radioButton = node;
            console.log(this.radioButton.checked);
        }
    }}
/>
```

Name | Type | Description
:--- | :--- | :----------
checked | Boolean | Get the checked state.

## License

MIT

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