{
  "_id": "@rc-component/switch",
  "maintainers": [
    {
      "name": "zombiej",
      "email": "smith3816@gmail.com"
    },
    {
      "name": "afc163",
      "email": "afc163@gmail.com"
    },
    {
      "name": "madccc",
      "email": "1075746765@qq.com"
    },
    {
      "name": "peachscript",
      "email": "scdzwyxst@gmail.com"
    },
    {
      "name": "chenshuai2144",
      "email": "wasd2144@hotmail.com"
    }
  ],
  "keywords": [
    "react",
    "react-component",
    "react-switch",
    "switch"
  ],
  "dist-tags": {
    "latest": "1.0.3"
  },
  "_rev": "5-acf38285d729e486eaaab0a4a9fd240c",
  "description": "switch ui component for react",
  "readme": "# rc-switch\n\n---\n\nSwitch ui component for react.\n\n[![NPM version][npm-image]][npm-url]\n[![npm download][download-image]][download-url]\n[![build status][github-actions-image]][github-actions-url]\n[![Test coverage][codecov-image]][codecov-url]\n[![bundle size][bundlephobia-image]][bundlephobia-url]\n\n[npm-image]: http://img.shields.io/npm/v/rc-switch.svg?style=flat-square\n[npm-url]: http://npmjs.org/package/rc-switch\n[travis-image]: https://img.shields.io/travis/react-component/switch/master?style=flat-square\n[travis-url]: https://travis-ci.com/react-component/switch\n[github-actions-image]: https://github.com/react-component/switch/workflows/CI/badge.svg\n[github-actions-url]: https://github.com/react-component/switch/actions\n[codecov-image]: https://img.shields.io/codecov/c/github/react-component/switch/master.svg?style=flat-square\n[codecov-url]: https://app.codecov.io/gh/react-component/switch\n[david-url]: https://david-dm.org/react-component/switch\n[david-image]: https://david-dm.org/react-component/switch/status.svg?style=flat-square\n[david-dev-url]: https://david-dm.org/react-component/switch?type=dev\n[david-dev-image]: https://david-dm.org/react-component/switch/dev-status.svg?style=flat-square\n[download-image]: https://img.shields.io/npm/dm/rc-switch.svg?style=flat-square\n[download-url]: https://npmjs.org/package/rc-switch\n[bundlephobia-url]: https://bundlephobia.com/package/rc-switch\n[bundlephobia-image]: https://badgen.net/bundlephobia/minzip/rc-switch\n\n## Install\n\n[![rc-switch](https://nodei.co/npm/rc-switch.png)](https://npmjs.org/package/rc-switch)\n\n## Usage\n\n```js\nimport Switch from 'rc-switch';\n\nexport default () => <Switch />;\n```\n\n## Compatibility\n\n| [<img src=\"https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png\" alt=\"IE / Edge\" width=\"24px\" height=\"24px\" />](http://godban.github.io/browsers-support-badges/)<br>IE / Edge | [<img src=\"https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png\" alt=\"Firefox\" width=\"24px\" height=\"24px\" />](http://godban.github.io/browsers-support-badges/)<br>Firefox | [<img src=\"https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png\" alt=\"Chrome\" width=\"24px\" height=\"24px\" />](http://godban.github.io/browsers-support-badges/)<br>Chrome | [<img src=\"https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png\" alt=\"Safari\" width=\"24px\" height=\"24px\" />](http://godban.github.io/browsers-support-badges/)<br>Safari | [<img src=\"https://raw.githubusercontent.com/alrra/browser-logos/master/src/electron/electron_48x48.png\" alt=\"Electron\" width=\"24px\" height=\"24px\" />](http://godban.github.io/browsers-support-badges/)<br>Electron |\n| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| IE11, Edge                                                                                                                                                                                                     | last 2 versions                                                                                                                                                                                                  | last 2 versions                                                                                                                                                                                              | last 2 versions                                                                                                                                                                                              | last 2 versions                                                                                                                                                                                                      |\n\n## API\n\n| Property       | Type                     | Default   | Description                                              |\n| -------------- | ------------------------ | --------- | -------------------------------------------------------- |\n| prefixCls      | String                   | rc-switch |                                                          |\n| className      | String                   | ''        | additional class name of root node                       |\n| checked        | boolean                  | false     | whether switch is checked                                |\n| defaultChecked | boolean                  | false     | whether switch is checked on init                        |\n| onChange       | Function(checked, event) |           | called when switch is checked or unchecked               |\n| tabIndex       | number                   |           | tab-index of switch node                                 |\n| onClick        | Function(checked, event) |           | called when switch is clicked                            |\n| autoFocus      | boolean                  |           | get focus when mounts                                    |\n| disabled       | boolean                  | false     | whether switch is disabled                               |\n| loadingIcon    | React.ReactNode          |           | specific the extra node. generally used in loading icon. |\n\n## Development\n\n```\nnpm install\nnpm start\n```\n\nOnline demo: http://react-component.github.io/switch/\n\n## License\n\nrc-switch is released under the MIT license.\n",
  "repository": {
    "type": "git",
    "url": "git+ssh://git@github.com/react-component/switch.git"
  },
  "bugs": {
    "url": "http://github.com/react-component/switch/issues"
  },
  "license": "MIT",
  "versions": {
    "1.0.0": {
      "name": "@rc-component/switch",
      "version": "1.0.0",
      "keywords": [
        "react",
        "react-component",
        "react-switch",
        "switch"
      ],
      "license": "MIT",
      "_id": "@rc-component/switch@1.0.0",
      "maintainers": [
        {
          "name": "zombiej",
          "email": "smith3816@gmail.com"
        },
        {
          "name": "afc163",
          "email": "afc163@gmail.com"
        },
        {
          "name": "madccc",
          "email": "1075746765@qq.com"
        },
        {
          "name": "peachscript",
          "email": "scdzwyxst@gmail.com"
        }
      ],
      "homepage": "http://github.com/react-component/switch",
      "bugs": {
        "url": "http://github.com/react-component/switch/issues"
      },
      "dist": {
        "shasum": "5c6f3e1fbd0e4b4f5853f09605ed234be456d85a",
        "tarball": "https://archive.ito.gov.ir/npm/_packages/@rc-component/switch/-/switch-1.0.0.tgz",
        "fileCount": 8,
        "integrity": "sha512-Owz1mxhGqgzoPpf0CLPd7W4SS5wsDEe2bHo+APTgzMPqB5g+jRGYe+WO1SY9kw6Pif23xyY+nhkHBqSqkXifuw==",
        "signatures": [
          {
            "sig": "MEUCIQCvIXjO1NdaT1B5iNZp8D2PSWKf/OB412u3uwAeistZeAIgf7oaA6pCFUDYcU9KWIAS+zoP8lnweUeMk4ANJkhAcZo=",
            "keyid": "SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"
          }
        ],
        "unpackedSize": 20013
      },
      "main": "lib/index",
      "types": "./lib/index.d.ts",
      "module": "./es/index",
      "gitHead": "86b71621b50571b176ceb5e1749d0c67d7384a3e",
      "scripts": {
        "lint": "eslint .",
        "test": "umi-test",
        "start": "dumi dev",
        "compile": "father build && lessc assets/index.less assets/index.css",
        "prepare": "husky install && dumi setup",
        "gh-pages": "npm run docs:build && npm run docs:deploy",
        "docs:build": "dumi build",
        "docs:deploy": "gh-pages -d .doc",
        "lint-staged": "lint-staged",
        "postpublish": "npm run gh-pages",
        "prepublishOnly": "npm run compile && rc-np"
      },
      "_npmUser": {
        "name": "zombiej",
        "email": "smith3816@gmail.com"
      },
      "repository": {
        "url": "git+ssh://git@github.com/react-component/switch.git",
        "type": "git"
      },
      "_npmVersion": "10.8.2",
      "description": "switch ui component for react",
      "directories": {},
      "lint-staged": {
        "**/*.{js,jsx,tsx,ts,md,json}": [
          "prettier --write"
        ]
      },
      "_nodeVersion": "22.5.1",
      "dependencies": {
        "classnames": "^2.2.1",
        "@rc-component/util": "^1.2.0"
      },
      "_hasShrinkwrap": false,
      "devDependencies": {
        "dumi": "^2.0.0",
        "less": "^4.1.3",
        "husky": "^8.0.1",
        "react": "^16.0.0",
        "enzyme": "^3.0.0",
        "eslint": "^8.55.0",
        "father": "^4.0.0",
        "cheerio": "1.0.0-rc.12",
        "gh-pages": "^6.1.0",
        "prettier": "^3.1.0",
        "umi-test": "^1.9.7",
        "react-dom": "^16.0.0",
        "@types/jest": "^29.4.0",
        "lint-staged": "^15.1.0",
        "@umijs/fabric": "^3.0.0",
        "enzyme-to-json": "^3.0.0",
        "@rc-component/np": "^1.0.3",
        "@types/classnames": "^2.2.10",
        "eslint-plugin-jest": "^27.6.0",
        "react-test-renderer": "^16.0.0",
        "eslint-plugin-unicorn": "^49.0.0",
        "enzyme-adapter-react-16": "^1.0.1",
        "@rc-component/father-plugin": "^2.0.0"
      },
      "peerDependencies": {
        "react": ">=16.9.0",
        "react-dom": ">=16.9.0"
      },
      "_npmOperationalInternal": {
        "tmp": "tmp/switch_1.0.0_1739776772135_0.0633375629324846",
        "host": "s3://npm-registry-packages-npm-production"
      }
    },
    "1.0.1": {
      "name": "@rc-component/switch",
      "version": "1.0.1",
      "keywords": [
        "react",
        "react-component",
        "react-switch",
        "switch"
      ],
      "license": "MIT",
      "_id": "@rc-component/switch@1.0.1",
      "maintainers": [
        {
          "name": "zombiej",
          "email": "smith3816@gmail.com"
        },
        {
          "name": "afc163",
          "email": "afc163@gmail.com"
        },
        {
          "name": "madccc",
          "email": "1075746765@qq.com"
        },
        {
          "name": "peachscript",
          "email": "scdzwyxst@gmail.com"
        },
        {
          "name": "chenshuai2144",
          "email": "wasd2144@hotmail.com"
        }
      ],
      "homepage": "http://github.com/react-component/switch",
      "bugs": {
        "url": "http://github.com/react-component/switch/issues"
      },
      "dist": {
        "shasum": "455dddb0549f2bb55b85ecc12e1716f96955a064",
        "tarball": "https://archive.ito.gov.ir/npm/_packages/@rc-component/switch/-/switch-1.0.1.tgz",
        "fileCount": 8,
        "integrity": "sha512-wADOlMU8xUkNHmLiv0eLSxZ9j4W1eaj9GH7mWYbSKOI/N1CbdZtz6kIllT5gdBdN4GBEQj86OiGte46Ot0xj3Q==",
        "signatures": [
          {
            "sig": "MEUCIQDJdmne6JEvHdiWZOW81Ij9vc8pv3/KmO/5/4emzGVuwQIgf1j9rButBRblSQuRJ+Xat5hZJFS4V/LOopGKhIgSV+I=",
            "keyid": "SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"
          }
        ],
        "unpackedSize": 19971
      },
      "main": "lib/index",
      "types": "./lib/index.d.ts",
      "module": "./es/index",
      "gitHead": "8e2a58548048ad56a2ce322200796d41133a4379",
      "scripts": {
        "lint": "eslint .",
        "test": "umi-test",
        "start": "dumi dev",
        "compile": "father build && lessc assets/index.less assets/index.css",
        "prepare": "husky install && dumi setup",
        "gh-pages": "npm run docs:build && npm run docs:deploy",
        "docs:build": "dumi build",
        "docs:deploy": "gh-pages -d .doc",
        "lint-staged": "lint-staged",
        "postpublish": "npm run gh-pages",
        "prepublishOnly": "npm run compile && rc-np"
      },
      "_npmUser": {
        "name": "zombiej",
        "email": "smith3816@gmail.com"
      },
      "repository": {
        "url": "git+ssh://git@github.com/react-component/switch.git",
        "type": "git"
      },
      "_npmVersion": "10.9.2",
      "description": "switch ui component for react",
      "directories": {},
      "lint-staged": {
        "**/*.{js,jsx,tsx,ts,md,json}": [
          "prettier --write"
        ]
      },
      "_nodeVersion": "22.15.1",
      "dependencies": {
        "classnames": "^2.2.1",
        "@rc-component/util": "^1.3.0"
      },
      "_hasShrinkwrap": false,
      "devDependencies": {
        "dumi": "^2.0.0",
        "less": "^4.1.3",
        "husky": "^8.0.1",
        "react": "^16.0.0",
        "enzyme": "^3.0.0",
        "eslint": "^8.55.0",
        "father": "^4.0.0",
        "cheerio": "1.0.0-rc.12",
        "gh-pages": "^6.1.0",
        "prettier": "^3.1.0",
        "umi-test": "^1.9.7",
        "react-dom": "^16.0.0",
        "@types/jest": "^29.4.0",
        "lint-staged": "^15.1.0",
        "@umijs/fabric": "^3.0.0",
        "enzyme-to-json": "^3.0.0",
        "@rc-component/np": "^1.0.3",
        "@types/classnames": "^2.2.10",
        "eslint-plugin-jest": "^27.6.0",
        "react-test-renderer": "^16.0.0",
        "eslint-plugin-unicorn": "^49.0.0",
        "enzyme-adapter-react-16": "^1.0.1",
        "@rc-component/father-plugin": "^2.0.0"
      },
      "peerDependencies": {
        "react": ">=16.9.0",
        "react-dom": ">=16.9.0"
      },
      "_npmOperationalInternal": {
        "tmp": "tmp/switch_1.0.1_1758006871045_0.5645737717504784",
        "host": "s3://npm-registry-packages-npm-production"
      }
    },
    "1.0.2": {
      "name": "@rc-component/switch",
      "version": "1.0.2",
      "keywords": [
        "react",
        "react-component",
        "react-switch",
        "switch"
      ],
      "license": "MIT",
      "_id": "@rc-component/switch@1.0.2",
      "maintainers": [
        {
          "name": "zombiej",
          "email": "smith3816@gmail.com"
        },
        {
          "name": "afc163",
          "email": "afc163@gmail.com"
        },
        {
          "name": "madccc",
          "email": "1075746765@qq.com"
        },
        {
          "name": "peachscript",
          "email": "scdzwyxst@gmail.com"
        },
        {
          "name": "chenshuai2144",
          "email": "wasd2144@hotmail.com"
        }
      ],
      "homepage": "http://github.com/react-component/switch",
      "bugs": {
        "url": "http://github.com/react-component/switch/issues"
      },
      "dist": {
        "shasum": "9f44dd22b2b9221d463f693175a39dfe3764c780",
        "tarball": "https://archive.ito.gov.ir/npm/_packages/@rc-component/switch/-/switch-1.0.2.tgz",
        "fileCount": 8,
        "integrity": "sha512-m0vjpdmrSYw55dXwxWxCwwM798lr1Jt30R7rVUOzRfPrnxIa/dJtN/BckR4gpPaDosjoRu/UPal3pLxQUIB/Rw==",
        "signatures": [
          {
            "sig": "MEUCIQDL7ZA+MMDtoW7S1SkZi2UoP7ZVBV2vVSFrI8CzMqI94wIgHAalFbvPW9MBEbeMLrgZI7Jj//pMycRkvFSpeVGMoF4=",
            "keyid": "SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"
          }
        ],
        "unpackedSize": 19975
      },
      "main": "lib/index",
      "types": "./lib/index.d.ts",
      "module": "./es/index",
      "gitHead": "4b11bd712d2de7dbc6025e2a6f4024f6590685f5",
      "scripts": {
        "lint": "eslint .",
        "test": "umi-test",
        "start": "dumi dev",
        "compile": "father build && lessc assets/index.less assets/index.css",
        "prepare": "husky install && dumi setup",
        "gh-pages": "npm run docs:build && npm run docs:deploy",
        "docs:build": "dumi build",
        "docs:deploy": "gh-pages -d .doc",
        "lint-staged": "lint-staged",
        "postpublish": "npm run gh-pages",
        "prepublishOnly": "npm run compile && rc-np"
      },
      "_npmUser": {
        "name": "zombiej",
        "email": "smith3816@gmail.com"
      },
      "repository": {
        "url": "git+ssh://git@github.com/react-component/switch.git",
        "type": "git"
      },
      "_npmVersion": "10.9.2",
      "description": "switch ui component for react",
      "directories": {},
      "lint-staged": {
        "**/*.{js,jsx,tsx,ts,md,json}": [
          "prettier --write"
        ]
      },
      "_nodeVersion": "22.15.1",
      "dependencies": {
        "classnames": "^2.2.1",
        "@rc-component/util": "^1.3.0"
      },
      "_hasShrinkwrap": false,
      "devDependencies": {
        "dumi": "^2.0.0",
        "less": "^4.1.3",
        "husky": "^8.0.1",
        "react": "^16.0.0",
        "enzyme": "^3.0.0",
        "eslint": "^8.55.0",
        "father": "^4.0.0",
        "cheerio": "1.0.0-rc.12",
        "gh-pages": "^6.1.0",
        "prettier": "^3.1.0",
        "umi-test": "^1.9.7",
        "react-dom": "^16.0.0",
        "@types/jest": "^29.4.0",
        "lint-staged": "^15.1.0",
        "@umijs/fabric": "^3.0.0",
        "enzyme-to-json": "^3.0.0",
        "@rc-component/np": "^1.0.3",
        "@types/classnames": "^2.2.10",
        "eslint-plugin-jest": "^27.6.0",
        "react-test-renderer": "^16.0.0",
        "eslint-plugin-unicorn": "^49.0.0",
        "enzyme-adapter-react-16": "^1.0.1",
        "@rc-component/father-plugin": "^2.0.0"
      },
      "peerDependencies": {
        "react": ">=16.9.0",
        "react-dom": ">=16.9.0"
      },
      "_npmOperationalInternal": {
        "tmp": "tmp/switch_1.0.2_1758263474389_0.27528493327654213",
        "host": "s3://npm-registry-packages-npm-production"
      }
    },
    "1.0.3": {
      "name": "@rc-component/switch",
      "version": "1.0.3",
      "description": "switch ui component for react",
      "keywords": [
        "react",
        "react-component",
        "react-switch",
        "switch"
      ],
      "homepage": "http://github.com/react-component/switch",
      "bugs": {
        "url": "http://github.com/react-component/switch/issues"
      },
      "repository": {
        "type": "git",
        "url": "git+ssh://git@github.com/react-component/switch.git"
      },
      "license": "MIT",
      "main": "lib/index",
      "module": "./es/index",
      "scripts": {
        "compile": "father build && lessc assets/index.less assets/index.css",
        "docs:build": "dumi build",
        "docs:deploy": "gh-pages -d .doc",
        "gh-pages": "npm run docs:build && npm run docs:deploy",
        "lint": "eslint .",
        "lint-staged": "lint-staged",
        "prepare": "husky install && dumi setup",
        "prepublishOnly": "npm run compile && rc-np",
        "postpublish": "npm run gh-pages",
        "start": "dumi dev",
        "test": "umi-test"
      },
      "lint-staged": {
        "**/*.{js,jsx,tsx,ts,md,json}": [
          "prettier --write"
        ]
      },
      "dependencies": {
        "@rc-component/util": "^1.3.0",
        "clsx": "^2.1.1"
      },
      "devDependencies": {
        "@rc-component/father-plugin": "^2.0.0",
        "@rc-component/np": "^1.0.3",
        "@types/jest": "^29.4.0",
        "@types/node": "^24.5.2",
        "@types/react": "^19.1.14",
        "@types/react-dom": "^19.1.9",
        "@umijs/fabric": "^3.0.0",
        "cheerio": "1.0.0-rc.12",
        "dumi": "^2.0.0",
        "enzyme": "^3.0.0",
        "enzyme-adapter-react-16": "^1.0.1",
        "enzyme-to-json": "^3.0.0",
        "eslint": "^8.55.0",
        "eslint-plugin-jest": "^27.6.0",
        "eslint-plugin-unicorn": "^49.0.0",
        "father": "^4.0.0",
        "gh-pages": "^6.1.0",
        "husky": "^8.0.1",
        "less": "^4.1.3",
        "lint-staged": "^15.1.0",
        "prettier": "^3.1.0",
        "react": "^16.0.0",
        "react-dom": "^16.0.0",
        "react-test-renderer": "^16.0.0",
        "umi-test": "^1.9.7"
      },
      "peerDependencies": {
        "react": ">=16.9.0",
        "react-dom": ">=16.9.0"
      },
      "_id": "@rc-component/switch@1.0.3",
      "gitHead": "552d3205dea2f788d4de01bb2435275afd0d4b16",
      "types": "./lib/index.d.ts",
      "_nodeVersion": "22.8.0",
      "_npmVersion": "11.6.0",
      "dist": {
        "integrity": "sha512-Jgi+EbOBquje/XNdofr7xbJQZPYJP+BlPfR0h+WN4zFkdtB2EWqEfvkXJWeipflwjWip0/17rNbxEAqs8hVHfw==",
        "shasum": "d6efa8a17ca9c35f0838321c1cfe0b9adb954523",
        "tarball": "https://archive.ito.gov.ir/npm/_packages/@rc-component/switch/-/switch-1.0.3.tgz",
        "fileCount": 8,
        "unpackedSize": 19941,
        "signatures": [
          {
            "keyid": "SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U",
            "sig": "MEQCIAysxtRWRLhfU/70ZQylXG9mgijiz2NHQdWjJ7zKPiZIAiAKOUdvLIMpimezpttrqdlTaHAnzbozUf52I9lre5GuPw=="
          }
        ]
      },
      "_npmUser": {
        "name": "afc163",
        "email": "afc163@gmail.com"
      },
      "directories": {},
      "maintainers": [
        {
          "name": "zombiej",
          "email": "smith3816@gmail.com"
        },
        {
          "name": "afc163",
          "email": "afc163@gmail.com"
        },
        {
          "name": "madccc",
          "email": "1075746765@qq.com"
        },
        {
          "name": "peachscript",
          "email": "scdzwyxst@gmail.com"
        },
        {
          "name": "chenshuai2144",
          "email": "wasd2144@hotmail.com"
        }
      ],
      "_npmOperationalInternal": {
        "host": "s3://npm-registry-packages-npm-production",
        "tmp": "tmp/switch_1.0.3_1764298681409_0.6972996817013153"
      },
      "_hasShrinkwrap": false
    }
  },
  "name": "@rc-component/switch",
  "time": {
    "created": "2025-02-17T07:19:32.020Z",
    "modified": "2026-05-20T01:37:30.880Z",
    "1.0.0": "2025-02-17T07:19:32.311Z",
    "1.0.1": "2025-09-16T07:14:31.247Z",
    "1.0.2": "2025-09-19T06:31:14.559Z",
    "1.0.3": "2025-11-28T02:58:01.580Z"
  },
  "readmeFilename": "README.md",
  "homepage": "http://github.com/react-component/switch"
}