{"name":"rc-segmented","version":"2.6.0","keywords":["react","react-component","react-segmented","react-segmented-controls","segmented controls","antd","ant-design"],"license":"MIT","_id":"rc-segmented@2.6.0","homepage":"https://react-component.github.io/segmented","bugs":{"url":"http://github.com/react-component/segmented/issues"},"cnpm":{"mode":"npm"},"dist":{"shasum":"c4eb1db393db3fa4a5938032bc6244b97e0879c0","tarball":"http://registry-npm.ywwl.com/rc-segmented/download/rc-segmented-2.6.0.tgz","fileCount":14,"integrity":"sha512-uItdhEFmCUsSBqpYwMYLW6JQ97Moyp4PGKwYvkdkgNQo9pwEDQ0z24KwEnYDast7/FYZLdUg7bs7GYBJJsFK+g==","signatures":[{"sig":"MEUCIAy4Dq5GXwIwch/HZL0BNRtpgEPnN6blA/I58260L2c6AiEAssZQ2b95o2+OplQPvMtcyVXwBIfwyts6xlsXHsLk7Go=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":45434,"size":8914,"noattachment":false,"key":"/rc-segmented/-/rc-segmented-2.6.0.tgz"},"main":"./lib/index","tnpm":{"mode":"npm"},"types":"./es/index.d.ts","module":"./es/index","gitHead":"f29b18cd911cf3af23cc3acc907e145c29520d64","scripts":{"lint":"eslint src/ --ext .ts,.tsx,.jsx,.js,.md","test":"jest","start":"dumi dev","compile":"father build && lessc assets/index.less assets/index.css","prepare":"husky install","coverage":"jest --coverage","gh-pages":"GH_PAGES=1 npm run docs:build && npm run docs:deploy","prettier":"prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"","docs:build":"dumi build","type:check":"tsc --noEmit","docs:deploy":"gh-pages -d .doc","pretty-quick":"pretty-quick","prepublishOnly":"npm run compile && np --yolo --no-publish && npm run gh-pages"},"_npmUser":{"name":"afc163","email":"afc163@gmail.com"},"repository":{"url":"git+ssh://git@github.com/react-component/segmented.git","type":"git"},"_npmVersion":"10.8.3","description":"React segmented controls used in ant.design","directories":{},"_nodeVersion":"22.8.0","dependencies":{"rc-util":"^5.17.0","rc-motion":"^2.4.4","classnames":"^2.2.1","@babel/runtime":"^7.11.1"},"_hasShrinkwrap":false,"devDependencies":{"np":"^7.0.0","dumi":"^2.1.2","jest":"^29.3.1","less":"^3.10.3","husky":"^8.0.0","react":"^18.0.0","eslint":"^7.0.0","father":"^4.1.1","ts-node":"^10.9.1","cssstyle":"^2.3.0","gh-pages":"^3.1.0","prettier":"^2.0.5","coveralls":"^3.0.6","cross-env":"^7.0.3","react-dom":"^18.0.0","typescript":"^5.3.0","@types/jest":"^29.2.4","@umijs/test":"^4.0.36","@types/react":"^18.3.11","pretty-quick":"^3.0.0","@umijs/fabric":"^3.0.0","@types/react-dom":"^18.3.1","@types/classnames":"^2.2.9","@testing-library/react":"^14.2.1","jest-environment-jsdom":"^29.3.1","@testing-library/jest-dom":"^5.16.5","@rc-component/father-plugin":"^1.0.1"},"peerDependencies":{"react":">=16.0.0","react-dom":">=16.0.0"},"_npmOperationalInternal":{"tmp":"tmp/rc-segmented_2.6.0_1732162386568_0.49794363400761643","host":"s3://npm-registry-packages"},"readme":"# rc-segmented\n\n[![NPM version][npm-image]][npm-url] [![npm download][download-image]][download-url] [![dumi](https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square)](https://github.com/umijs/dumi) [![build status][github-actions-image]][github-actions-url] [![Codecov][codecov-image]][codecov-url] [![bundle size][bundlephobia-image]][bundlephobia-url]\n\n[npm-image]: http://img.shields.io/npm/v/rc-segmented.svg?style=flat-square\n[npm-url]: http://npmjs.org/package/rc-segmented\n[github-actions-image]: https://github.com/react-component/segmented/workflows/CI/badge.svg\n[github-actions-url]: https://github.com/react-component/segmented/actions\n[codecov-image]: https://codecov.io/gh/react-component/segmented/branch/master/graph/badge.svg\n[codecov-url]: https://codecov.io/gh/react-component/segmented/branch/master\n[download-image]: https://img.shields.io/npm/dm/rc-segmented.svg?style=flat-square\n[download-url]: https://npmjs.org/package/rc-segmented\n[bundlephobia-url]: https://bundlephobia.com/package/rc-segmented\n[bundlephobia-image]: https://badgen.net/bundlephobia/minzip/rc-segmented\n\nReact Segmented Control.\n\n![](https://gw.alipayobjects.com/mdn/rms_50855f/afts/img/A*bmGGQpnWs0oAAAAAAAAAAAAAARQnAQ)\n\n## Live Demo\n\nhttps://react-component.github.io/segmented/\n\n## Install\n\n[![rc-segmented](https://nodei.co/npm/rc-segmented.png)](https://npmjs.org/package/rc-segmented)\n\n## Usage\n\n```js\nimport Segmented from 'rc-segmented';\nimport 'rc-segmented/assets/index.css'; // import 'rc-segmented/asssets/index.less';\nimport { render } from 'react-dom';\n\nrender(\n  <Segmented\n    options={['Antd', 'Antv', 'Egg.js']}\n    onChange={(value) => handleValueChange(value)}\n  />,\n  mountNode,\n);\n```\n\n## API\n\nPlease note that **onChange** API\n changed on v2.0.0+\n\n| Property     | Type                                                           | Default      | Description                        |\n| --------- | --------- | --------- | --------- |\n| prefixCls    | string                                                         | rc-segmented | prefixCls of this component |\n| className    | string                                                         | ''           | additional class name of segmented |\n| style        | React.CSSProperties                                            |              | style properties of segmented      |\n| options      | Array<string \\| number \\| [SegmentedOption](#SegmentedOption)> | []           | options for choices                |\n| value        | string \\| number                                               |              | value of segmented                 |\n| defaultValue | string \\| number                                               |              | defaultValue of segmented          |\n| value | string \\| number                                               |              | currently selected value of segmented          |\n| onChange     | (value: string \\| number) => void                                               |              | defaultValue of segmented          |\n| disabled     | boolean                                                        | false        | disabled status of segmented       |\n\n### SegmentedOption\n\n| Property  | Type      | Default | Description                               |\n| --------- | --------- | --------- | --------- |\n| label     | ReactNode |         | label of segmented option                 |\n| value     | string \\| number   |  | value of segmented option |\n| className | string    | ''      | additional class name of segmented option |\n| disabled  | boolean   | false   | disabled status of segmented option       |\n\n## Development\n\n```\nnpm install\nnpm start\n```\n\n## License\n\nrc-segmented is released under the MIT license.\n","publish_time":1732162386813,"maintainers":[{"name":"afc163","email":"afc163@gmail.com"},{"name":"vagusx","email":"onlylae@sina.com"},{"name":"zombiej","email":"smith3816@gmail.com"}],"_cnpm_publish_time":1732162386813,"dist-tags":{"beta":"2.1.0-beta.0","latest":"2.7.1"}}