{"id":30580534,"url":"https://github.com/react-component/tabs","last_synced_at":"2025-08-29T05:36:47.505Z","repository":{"id":24454891,"uuid":"27857691","full_name":"react-component/tabs","owner":"react-component","description":"React Tabs","archived":false,"fork":false,"pushed_at":"2025-08-22T21:23:47.000Z","size":13080,"stargazers_count":573,"open_issues_count":116,"forks_count":243,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-08-24T09:11:22.650Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://tabs.react-component.now.sh/","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":".github/FUNDING.yml","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},"funding":{"github":"ant-design","patreon":null,"open_collective":"ant-design","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"thanks_dev":null,"custom":null}},"created_at":"2014-12-11T06:37:05.000Z","updated_at":"2025-07-25T03:09:51.000Z","dependencies_parsed_at":"2024-02-25T13:43:32.967Z","dependency_job_id":"ea2e5543-2eb4-40cb-8834-2b9d7b85ee76","html_url":"https://github.com/react-component/tabs","commit_stats":{"total_commits":615,"total_committers":84,"mean_commits":7.321428571428571,"dds":0.7463414634146341,"last_synced_commit":"534721cccde398d499e1468b82d70c4733dc8991"},"previous_names":[],"tags_count":250,"template":false,"template_full_name":null,"purl":"pkg:github/react-component/tabs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-component%2Ftabs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-component%2Ftabs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-component%2Ftabs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-component%2Ftabs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/react-component","download_url":"https://codeload.github.com/react-component/tabs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-component%2Ftabs/sbom","scorecard":{"id":765412,"data":{"date":"2025-08-11","repo":{"name":"github.com/react-component/tabs","commit":"d715240130cea7e5b0c7201ac9bde9bc7cda6427"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.8,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":1,"reason":"2 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":3,"reason":"Found 10/27 approved changesets -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/main.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:5: update your workflow using https://app.stepsecurity.io/secureworkflow/react-component/tabs/main.yml/master?enable=pin","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: MIT License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 20 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-23T00:37:47.119Z","repository_id":24454891,"created_at":"2025-08-23T00:37:47.120Z","updated_at":"2025-08-23T00:37:47.120Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272636158,"owners_count":24967983,"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","status":"online","status_checked_at":"2025-08-29T02:00:10.610Z","response_time":87,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-08-29T05:36:43.641Z","updated_at":"2025-08-29T05:36:47.497Z","avatar_url":"https://github.com/react-component.png","language":"TypeScript","funding_links":["https://github.com/sponsors/ant-design","https://opencollective.com/ant-design"],"categories":[],"sub_categories":[],"readme":"# rc-tabs\n\n---\n\nReact Tabs component.\n\n[![NPM version][npm-image]][npm-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] [![Test coverage][codecov-image]][codecov-url] [![npm download][download-image]][download-url] [![bundle size][bundlephobia-image]][bundlephobia-url]\n\n[npm-image]: http://img.shields.io/npm/v/rc-tabs.svg?style=flat-square\n[npm-url]: http://npmjs.org/package/rc-tabs\n[github-actions-image]: https://github.com/react-component/tabs/workflows/CI/badge.svg\n[github-actions-url]: https://github.com/react-component/tabs/actions\n[codecov-image]: https://img.shields.io/codecov/c/github/react-component/tabs/master.svg?style=flat-square\n[codecov-url]: https://codecov.io/gh/react-component/tabs/branch/master\n[download-image]: https://img.shields.io/npm/dm/rc-tabs.svg?style=flat-square\n[download-url]: https://npmjs.org/package/rc-tabs\n[bundlephobia-url]: https://bundlephobia.com/result?p=rc-tabs\n[bundlephobia-image]: https://badgen.net/bundlephobia/minzip/rc-tabs\n\n## Screenshot\n\n\u003cimg src='https://zos.alipayobjects.com/rmsportal/JwLASrsOYJuFRIt.png' width='408'\u003e\n\n## Example\n\nhttp://localhost:8000/examples\n\nonline example: https://tabs.react-component.now.sh/\n\n## install\n\n[![rc-tabs](https://nodei.co/npm/rc-tabs.png)](https://npmjs.org/package/rc-tabs)\n\n## Feature\n\n### Keyboard\n\n- left and up: tabs to previous tab\n- right and down: tabs to next tab\n\n## Usage\n\n```tsx | pure\nimport Tabs from 'rc-tabs';\nimport ReactDom from 'react-dom';\n\nconst callback = key =\u003e {\n  console.log(key);\n};\n\nconst items = [\n  {\n    key: '1',\n    label: 'Google',\n    children: (\n      \u003cdiv className=\"text-xl\"\u003e\n        \u003cp\u003eLorem Ipsum is simply dummy text of the printing and typesetting\u003c/p\u003e\n      \u003c/div\u003e\n    ),\n  },\n  {\n    key: '2',\n    label: \u003cp\u003eAmazon\u003c/p\u003e,\n    children:\n      'Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit...',\n    disabled: true,\n  },\n  {\n    key: '3',\n    label: \u003cp\u003eTwitter\u003c/p\u003e,\n    children: (\n      \u003cdiv\u003e\n        \"There is no one who loves pain itself, who seeks after it and wants to have it, simply\n        because it is pain...\"\n      \u003c/div\u003e\n    ),\n  },\n];\n\nReactDom.render(\n  \u003cTabs\n    tabPosition=\"bottom\"\n    items={items}\n    defaultActiveKey=\"1\"\n    className=\"md:w-[70%] w-full mx-auto p-2 border-0\"\n    onChange={callback}\n    style={{ color: 'yellow' }}\n  /\u003e,\n  root,\n);\n```\n\n## API\n\n### Tabs\n\n| name | type | default | description |\n| --- | --- | --- | --- |\n| prefixCls | string | `'rc-tabs'` | prefix class name, use to custom style |\n| className | string | - | to define a class name for an element |\n| style | CSS properties | - | object with css properties for styling |\n| items | TabItem[] | [] | configure tab content |\n| id | string | - | unique identifier |\n| defaultActiveKey | string | - | initial active tabPanel's key if activeKey is absent |\n| activeKey | string | - | current active tabPanel's key |\n| direction | `'ltr' or 'rtl'` | `'ltr'` | Layout direction of tabs component |\n| animated | boolean \\| { inkBar: boolean, tabPane: boolean } | `{ inkBar: true, tabPane: false }` | config animation |\n| renderTabBar | (props, TabBarComponent) =\u003e ReactElement | - | How to render tab bar |\n| tabBarExtraContent | ReactNode \\| `{ left: ReactNode, right: ReactNode }` | - | config extra content |\n| tabBarGutter | number | 0 | config tab bar gutter |\n| tabBarPosition | `'left' \\| 'right' \\| 'top' \\| 'bottom'` | `'top'` | tab nav 's position |\n| tabBarStyle | style | - | tab nav style |\n| tabPosition | `'left' or 'right' or 'top' or 'bottom'` | `'top'` | tab nav 's position |\n| destroyOnHidden | boolean | false | whether destroy inactive TabPane when change tab |\n| onChange | (key) =\u003e void | - | called when tabPanel is changed |\n| onTabClick | (key) =\u003e void | - | called when tab click |\n| onTabScroll | ({ direction }) =\u003e void | - | called when tab scroll |\n| editable | { onEdit(type: 'add' \\| 'remove', info: { key, event }), showAdd: boolean, removeIcon: ReactNode, addIcon: ReactNode } | - | config tab editable |\n| locale | { dropdownAriaLabel: string, removeAriaLabel: string, addAriaLabel: string } | - | Accessibility locale help text |\n| moreIcon | ReactNode | - | collapse icon |\n\n### TabItem\n\n| name | type | default | description |\n| --- | --- | --- | --- |\n| key | string | - | corresponding to activeKey, should be unique |\n| label | string | - | TabPane's head display text |\n| tab | ReactNode | - | current tab's title corresponding to current tabPane |\n| className | string | - | to define a class name for an element |\n| style | CSS properties | - | object with css properties for styling |\n| disabled | boolean | false | set TabPane disabled |\n| children | ReactNode | - | TabPane's head display content |\n| forceRender | boolean | false | forced render of content in tabs, not lazy render after clicking on tabs |\n| closable | boolean | false | closable feature of tab item |\n| closeIcon | ReactNode | - | Config close icon |\n| prefixCls | string | `'rc-tabs-tab'` | prefix class name, use to custom style |\n| id | string | - | unique identifier |\n| animated | boolean \\| { inkBar: boolean, tabPane: boolean } | `{ inkBar: true, tabPane: false }` | config animation |\n| destroyOnHidden | boolean | false | whether destroy inactive TabPane when change tab |\n| active | boolean | false | active feature of tab item |\n| tabKey | string | - | key linked to tab |\n\n### TabPane(support in older versions)\n\n| name | type | default | description |\n| --- | --- | --- | --- |\n| destroyOnHidden | boolean | false | whether destroy inactive TabPane when change tab |\n| key | string | - | corresponding to activeKey, should be unique |\n| forceRender | boolean | false | forced render of content in tabs, not lazy render after clicking on tabs |\n| tab | ReactNode | - | current tab's title corresponding to current tabPane |\n| closeIcon | ReactNode | - | Config close icon |\n\n## Development\n\n```\nnpm install\nnpm start\n```\n\n## Test Case\n\n```\nnpm test\nnpm run chrome-test\n```\n\n## Coverage\n\n```\nnpm run coverage\n```\n\nopen coverage/ dir\n\n## License\n\nrc-tabs is released under the MIT license.\n\n## FAQ\n\n### Responsive Tabs\n\nThere are 3 cases when handling responsive tabs: ![image](https://user-images.githubusercontent.com/27722486/156315099-7e6eda9d-ab77-4b16-9b49-1727c5ec8b26.png)\n\nWe get hidden tabs through [useVisibleRange.ts](https://github.com/react-component/tabs/blob/master/src/hooks/useVisibleRange.ts). If enconter the third case, in order to make tabs responsive, some tabs should be hidden. So we minus `addSize` when calculating `basicSize` manully, even though there's no addNode in container. In this way, case 3 turns to case 2, tabs become stable again.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freact-component%2Ftabs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freact-component%2Ftabs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freact-component%2Ftabs/lists"}