{"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":"http://registry-npm.ywwl.com/@rc-component/switch/download/@rc-component/switch-1.0.3.tgz","fileCount":8,"unpackedSize":19941,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIAysxtRWRLhfU/70ZQylXG9mgijiz2NHQdWjJ7zKPiZIAiAKOUdvLIMpimezpttrqdlTaHAnzbozUf52I9lre5GuPw=="}],"size":5130,"noattachment":false,"key":"/@rc-component/switch/-/@rc-component/switch-1.0.3.tgz"},"_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,"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","publish_time":1764298681580,"_cnpm_publish_time":1764298681580,"dist-tags":{"latest":"1.0.3"}}