@cig/switch

0.0.3 • Public • Published

@cig/switch

The Switch control for React.

Demo

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.

npm i -S @cig/switch

Then use it in your App:

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 - 数据更新回调

Readme

Keywords

Package Sidebar

Install

npm i @cig/switch

Weekly Downloads

0

Version

0.0.3

License

ISC

Unpacked Size

15.3 kB

Total Files

7

Last publish

Collaborators

  • wu1989
  • loseyear
  • marken