# @beisen-phoenix/switch

> > 目前支持两种尺寸：`default|small`

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

## Install

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

## 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-08-27 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 30.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | beisencorp |

## Links

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

## Dependencies (3)

- [classnames](https://npm.io/package/classnames.md) ^2.2.6
- [@beisen-phoenix/icon](https://npm.io/package/@beisen-phoenix/icon.md) ^3.2.54
- [@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.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
- 3.3.41 — 2019-11-21
- … 205 more at https://npm.io/package/@beisen-phoenix/switch/versions

## README

## Switch 开关组件
> 目前支持两种尺寸：`default|small`

### API

| 参数 | 说明 | 类型 | 默认值 | 是否必传 | 备注 |
| --- | --- | :---: | :---: | :---: | --- |
| className | 自定义类名 | `string` | 无 | 否 |  |
| prefixCls | 自定义类名前缀 | `string` | `phoenix-switch` | 否 | 非必要时不建议使用，传值后需要自定义所有样式 |
| disabled | 是否可用 | `boolean` | `false` | 否 |  |
| size | 组件尺寸，可选值为`default、small` | `string` | `default` | 否 |  |
| checkedChildren | 开启状态时组件内显示的内容 | `ReactNode` | `null` | 否 |  |
| unCheckedChildren | 关闭状态时组件内显示的内容 | `ReactNode` | `null` | 否 |  |
| onChange | 状态改变时的回调, 参数为`checked`和`SyntheticEvent` | `function` | 无 | 否 |  |
| onMouseUp | 鼠标抬起时的回调，参数为`SyntheticEvent` | `function` | 无 | 否 |  |
| onClick | 点击回调, 参数为`checked`和`SyntheticEvent` | `function` | 无 | 否 |  |
| tabIndex | tabindex值 | `number` | `0` | 否 | 若tab键切换时不希望被遍历到，请设置值为-1 |
| checked | 开关状态 | `boolean` | `false` | 否 |  |
| defaultChecked | 开关默认状态 | `boolean` | `false` | 否 |  |
| autoFocus | 自动获得焦点 | `boolean` | `false` | 否 |  |
| loading | loading状态 | `boolean` | `false` | 否 |  |
| style | 内联样式 | `object` | 无 | 否 |  |

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