@ahwui/react-switch
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

react Switch 开关

开关选择器。

安装

npm install --save @ahwui/react-switch

引入

import Switch from '@ahwui/react-switch';

基本用法

import ReactDOM from 'react-dom';
import Switch from '@ahwui/react-switch';

ReactDOM.render(
  <div>
    <Switch
      checked
      checkedNode="开启"
      unCheckedNode="关闭"
    />
  </div>,
  _mount_
);

Props Switch

参数 说明 类型 默认值
checked 默认值 boolean false
disabled 禁用 boolean false
checkedNode 选中时的内容 ReactNode / string --
unCheckedNode 非选中时的内容 ReactNode / string --
onChange 选中时调用 function(checked: boolean) --

Dependencies (0)

    Dev Dependencies (4)

    Package Sidebar

    Install

    npm i @ahwui/react-switch

    Weekly Downloads

    4

    Version

    0.0.2

    License

    MIT

    Unpacked Size

    16.7 kB

    Total Files

    13

    Last publish

    Collaborators

    • uub