{"id":24617447,"url":"https://github.com/react-component/segmented","last_synced_at":"2025-04-04T08:08:47.749Z","repository":{"id":37063778,"uuid":"451312060","full_name":"react-component/segmented","owner":"react-component","description":"React Segmented Controls","archived":false,"fork":false,"pushed_at":"2025-01-24T09:54:46.000Z","size":2681,"stargazers_count":12,"open_issues_count":13,"forks_count":24,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-28T07:08:56.680Z","etag":null,"topics":["reactjs","segmented","segmented-controls"],"latest_commit_sha":null,"homepage":"https://react-component.github.io/segmented/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/react-component.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-24T04:11:22.000Z","updated_at":"2025-01-24T09:54:49.000Z","dependencies_parsed_at":"2023-12-20T19:47:45.927Z","dependency_job_id":"17bc39bf-d2c0-4af7-9d5a-8ee43844840a","html_url":"https://github.com/react-component/segmented","commit_stats":{"total_commits":73,"total_committers":18,"mean_commits":4.055555555555555,"dds":0.6712328767123288,"last_synced_commit":"b5b286d94c51e500ccf962e40848d336b0ecfd09"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":"react-component/footer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-component%2Fsegmented","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-component%2Fsegmented/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-component%2Fsegmented/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-component%2Fsegmented/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/react-component","download_url":"https://codeload.github.com/react-component/segmented/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247142068,"owners_count":20890652,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["reactjs","segmented","segmented-controls"],"created_at":"2025-01-24T23:24:44.768Z","updated_at":"2025-04-04T08:08:47.728Z","avatar_url":"https://github.com/react-component.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"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  \u003cSegmented\n    options={['Antd', 'Antv', 'Egg.js']}\n    onChange={(value) =\u003e handleValueChange(value)}\n  /\u003e,\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\u003cstring \\| number \\| [SegmentedOption](#SegmentedOption)\u003e | []           | 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) =\u003e 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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freact-component%2Fsegmented","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freact-component%2Fsegmented","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freact-component%2Fsegmented/lists"}