# bee-radio

> radio ui component for react

Latest version **2.1.6** (published 2020-05-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install bee-radio
pnpm add bee-radio
yarn add bee-radio
bun add bee-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 | 2.1.6 |
| Published | 2020-05-22 |
| First published | 2017-01-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4.0.0 |
| Dependencies | 2 |
| Unpacked size | 55 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Maintainers | ahua52, banyudu, bjyxszd, guoyongfeng, huayingjie, jonyw, kvkens, liushaozhen, liuyk, npm_yx, tinper-bot, whizbz, yangchch, yonyoufed, zhaoyuchief |
| Keywords | react, react-component, react-radio-group, iuap-design, neoui-react, radio-group, bee-radio |

## Links

- npm: https://www.npmjs.com/package/bee-radio
- Repository: https://github.com/tinper-bee/bee-radio
- Issues: https://github.com/tinper-bee/bee-radio/issues
- npm.io page: https://npm.io/package/bee-radio

## Dependencies (2)

- [classnames](https://npm.io/package/classnames.md) ^2.2.5
- [tinper-bee-core](https://npm.io/package/tinper-bee-core.md) ^2.0.28

## 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.1.6 (latest) — 2020-05-22
- 2.1.3-alpha.0 (alpha) — 2020-05-19
- 2.1.5 — 2020-04-24
- 2.1.4 — 2020-04-01
- 2.1.3 — 2020-04-01
- 2.1.2 — 2020-03-06
- 2.1.2-alpha.0 — 2020-03-02
- 2.1.1 — 2020-02-24
- 2.1.0 — 2020-02-21
- 2.1.0-alpha.0 — 2020-02-21
- 2.0.18 — 2019-10-17
- 2.0.18-alpha.0 — 2019-10-16
- 2.0.17 — 2019-09-30
- 2.0.17-alpha.0 — 2019-09-30
- 2.0.16 — 2019-08-23
- … 38 more at https://npm.io/package/bee-radio/versions

## README

# bee-radio
[![npm version](https://img.shields.io/npm/v/bee-radio.svg)](https://www.npmjs.com/package/bee-radio)
[![Build Status](https://img.shields.io/travis/tinper-bee/bee-radio/master.svg)](https://travis-ci.org/tinper-bee/bee-radio)
[![Coverage Status](https://coveralls.io/repos/github/tinper-bee/bee-radio/badge.svg?branch=master)](https://coveralls.io/github/tinper-bee/bee-radio?branch=master)

单选.

## 使用
使用单独的bee-radio包
#### 组件引入
先进行下载bee-radio包

```
npm install --save bee-radio
```
组件调用
```js
import Radio from 'bee-radio';
RadioGroup = Radio.RadioGroup;

const RadioApp = React.createClass({
  getInitialState() {
    return {selectedValue: 'apple'};
  },

  handleChange(value) {
    this.setState({selectedValue: value});
  },

  render() {
    return (
      <RadioGroup
        name="fruit"
        selectedValue={this.state.selectedValue}
        onChange={this.handleChange}>
        <label>
          <Radio colors="warning" value="apple" >apple</Radio>
        </label>
        <label>
          <Radio value="orange" >Orange</Radio>
        </label>
        <label>
          <Radio value="watermelon" >Watermelon</Radio>
        </label>
      </RadioGroup>
    );
  }
});

React.render(<RadioApp />, document.getElementById('target'));

```
#### 样式引入
- 可以使用link引入dist目录下bee-radio.css
```
<link rel="stylesheet" href="./node_modules/build/bee-radio.css">
```
- 可以在js中import样式
```js
import "./node_modules/src/Radio.scss"
//或是
import "./node_modules/build/bee-radio.css"
```


## API

## Radio

|参数|说明|类型|默认值|
|---|----|---|------|
|color|one of: `primary` `success` `info` `danger`  `warning` `dark`|string|''|
|disabled|是否可用|bool|false|
| style  | 添加style | object| {} |
|className|传入列的classname|String	|-|
|inverse|设置选中为红色填充|bool|false|

## RadioButton

|参数|说明|类型|默认值|
|:---|:----|:---|:------|
|color|one of: `primary` `success` `info` `danger`  `warning` `dark`|string|-|
|size|one of: `lg` `sm`|string|-|
|disabled|是否可用|bool|false|

## RadioGroup

|参数|说明|类型|默认值|
|---|----|---|------|
|onChange|暴露在外层的触发radio是否选中的方法|func|''|
|selectedValue|被选中的radio值|string|''|
|name|radio组名|string|''|
|Children|必填，Radio子组件|node|-|

## 已支持的键盘操作

|按键|功能|
|:---|:----|
|space |选中/反选Radio|
|→(右箭)、↓(下箭) |将焦点移动到下一个Radio上，依次循环选中|
|←(左箭)、↑(上箭) |将焦点移动到上一个Radio上，依次循环选中|

#### 开发调试

```sh
$ git clone https://github.com/tinper-bee/bee-radio
$ cd bee-radio-group
$ npm install
$ npm run dev
```

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