# @cig/switch

> React Switch Control

Latest version **0.0.3** (published 2020-12-24) · ISC license · 0 weekly downloads

## Install

```sh
npm install @cig/switch
pnpm add @cig/switch
yarn add @cig/switch
bun add @cig/switch
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2020-12-24 |
| First published | 2020-12-24 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 14.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | z |
| Maintainers | loseyear, marken, ancf |
| Keywords | react, switch, mobile |

## Links

- npm: https://www.npmjs.com/package/@cig/switch
- Repository: https://github.com/cig-data/x
- Homepage: https://github.com/cig-data/x/tree/master/packages/switch#readme
- Issues: https://github.com/cig-data/x/issues
- npm.io page: https://npm.io/package/@cig/switch

## Dependencies (3)

- [react](https://npm.io/package/react.md) ^16.13.1
- [react-dom](https://npm.io/package/react-dom.md) ^16.13.1
- [styled-components](https://npm.io/package/styled-components.md) ^5.1.1

## 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

- 0.0.3 (latest) — 2020-12-24
- 0.0.2 — 2020-12-24

## README

# @cig/switch
> The Switch control for React.

## Demo
[https://codesandbox.io/s/cigswitch-mlnkr](https://codesandbox.io/s/cigswitch-mlnkr)

## Installation and usage
> The easiest way to use @cig/switch is to install it from npm and build it into your app with Webpack.

```js
npm i -S @cig/switch
```

Then use it in your App:

```js
import React, {
  useState,
} from 'react'
import Switch from '@cig/switch'


export default () => {
  const [value, setValue] = useState(true)

  return (
    <Switch
      value={value}
      update={v => setValue(v)}
    />
  )
}
```

## Props

| 名称 | 类型 | 必填 | 默认值 | 描述 |
| --- | --- | --- | --- | --- |
| value | Array | N | - | 默认选项 |
| update | Function | N | - | 数据更新回调 |

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