# @beisen-phoenix/radio

> > @beisen-phoenix/radio

Latest version **3.3.55** (published 2019-11-25) · ISC license · 0 weekly downloads

## Install

```sh
npm install @beisen-phoenix/radio
pnpm add @beisen-phoenix/radio
yarn add @beisen-phoenix/radio
bun add @beisen-phoenix/radio
```

## 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 | 3.3.55 |
| Published | 2019-11-25 |
| First published | 2019-02-27 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 38.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | beisencorp |

## Links

- npm: https://www.npmjs.com/package/@beisen-phoenix/radio
- npm.io page: https://npm.io/package/@beisen-phoenix/radio

## Dependencies (2)

- [@beisen-phoenix/tooltip](https://npm.io/package/@beisen-phoenix/tooltip.md) ^3.3.55
- [@beisen-phoenix/style-token](https://npm.io/package/@beisen-phoenix/style-token.md) ^3.3.55

## Recent versions

- 3.3.55 (latest) — 2019-11-25
- 3.2.44-rc.1 (rc) — 2019-10-24
- 3.3.54 — 2019-11-25
- 3.3.53 — 2019-11-25
- 3.3.52 — 2019-11-24
- 3.3.51 — 2019-11-23
- 3.3.50 — 2019-11-22
- 3.3.49 — 2019-11-22
- 3.3.48 — 2019-11-22
- 3.3.47 — 2019-11-22
- 3.3.46 — 2019-11-22
- 3.3.45 — 2019-11-21
- 3.3.43 — 2019-11-21
- 3.3.42 — 2019-11-21
- 3.3.41-beta.1 — 2019-11-21
- … 374 more at https://npm.io/package/@beisen-phoenix/radio/versions

## README

# 按钮组件

> @beisen-phoenix/radio

## 概述

> 一个简单的Radio单选组件。

## API

| 参数 | 说明 | 类型 | 默认值 | 是否必传 |
| --- | --- | --- | --- | --- |
| label | Radio的文字说明 | (string、number、React.ReactNode) | - | No |
| value | Radio的值 | string、 number | - | Yes |
| checked | 是否选中该Radio（用于完全受控） | boolean | - | No |
| defaultChecked | 是否初始选中(常用于非受控状态) | boolean | - | No |
| disabled | 禁用radio，不可操作radio | boolean | - | No |
| extraCls | 生成的dom节点的后缀class,一般用于覆盖组件默认样式使用| string | 无| 否 |
| onChange | Radio 发生状态变化后的回调 | (data: RadioData,event) => void | - | No
| minWidth | 最小宽度：图标加文字宽度（有label时使用） | string | - | No |
| maxWidth | 最大宽度：图标加文字宽度（有label时使用） | string | - | No |
| fontSize | 文字大小 `normal`、 `middle` | string | 'normal' | 否 |
| textColor | 文字颜色 `M1` 、`M2`、 `M3` 、`M4` 、`M5` | string | 'M3' | 否 |



## 方法

组件提供一个getValue方法来获取当前Radio的值，您可以使用ref来调用

`this.RadioComponent.getValue()`

返回值的格式为
```
{
    label: string | number | React.ReactNode,
    value: string | number,
    checked: boolean
}
```
## tips:  2种不同的label传递方式
```$xslt
          <Radio value={11} label="选项11" />
```

```$xslt
          <Radio value={11}> 选项11</Radio>
```
## 开发人员
huhai@beisen.com

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