Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bee-switch

Package Overview
Dependencies
Maintainers
12
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bee-switch

switch ui component for react

  • 1.0.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
40
increased by53.85%
Maintainers
12
Weekly downloads
 
Created
Source

bee-switch

npm version Build Status Coverage Status dependencies Status NPM downloads Average time to resolve an issue Percentage of issues still open

两种状态切换的开关

使用

使用单独的switch包

组件引入

先进行下载switch包

npm install --save bee-switch

组件调用

import { Switch } from 'bee-switch';
React.render(<div>
            <Switch />
        </div>, document.getElementById('target'));
样式引入
  • 可以使用link引入dist目录下switch.css
<link rel="stylesheet" href="./node_modules/build/bee-switch.css">
  • 可以在js中import样式
import "./node_modules/src/Switch.scss"
//或是
import "./node_modules/build/bee-switch.css"

API

参数说明类型默认值
checked指定当前是否选中Booleanfalse
defaultChecked初始是否选中Booleanfalse
onChange变化时回调函数,自定义参照demoFunction(checked:Boolean)
disabled设置是否禁用Booleanfalse
checkedChildren选中时的内容ReactNode
unCheckedChildren非选中时的内容ReactNode
size大小设置,oneOf:primary,success,info,dark,warningstring''
colors颜色设置,oneOf:sm, lg,''string''
setup develop environment
$ git clone https://github.com/tinper-bee/bee-switch
$ cd bee-switch
$ npm install
$ npm run dev

Keywords

FAQs

Package last updated on 16 Jan 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc