{"name":"rc-tabs","version":"15.5.2","keywords":["react","react-component","react-tabs"],"author":{"name":"yiminghe@gmail.com"},"license":"MIT","_id":"rc-tabs@15.5.2","maintainers":[{"name":"benjycui","email":"benjytrys@gmail.com"},{"name":"yesmeck","email":"yesmeck@gmail.com"},{"name":"afc163","email":"afc163@gmail.com"},{"name":"paranoidjk","email":"hust2012jiangkai@gmail.com"},{"name":"zombiej","email":"smith3816@gmail.com"},{"name":"picodoth","email":"picodoth@gmail.com"},{"name":"madccc","email":"1075746765@qq.com"}],"homepage":"http://github.com/react-component/tabs","bugs":{"url":"http://github.com/react-component/tabs/issues"},"dist":{"shasum":"bca1d2f2ee1e609fa4d7527b3c1639319f035b0c","tarball":"http://registry-npm.ywwl.com/rc-tabs/download/rc-tabs-15.5.2.tgz","fileCount":84,"integrity":"sha512-Hbqf2IV6k/jPgfMjPtIDmPV0D0C9c/fN4B/fYcoh9qqaUzUZQoK0PYzsV3UaV+3UsmyoYt48p74m/HkLhGTw+w==","signatures":[{"sig":"MEQCIFI00TjvhXFC22viP2P1O9Go4aLauMmuA/rwy2vjm1LSAiA63o1oI49zE77sWj/sk8C2lqv8HiEric3PBu8NXhftfQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":174776,"size":26515,"noattachment":false,"key":"/rc-tabs/-/rc-tabs-15.5.2.tgz"},"main":"./lib/index","types":"./lib/index.d.ts","module":"./es/index","engines":{"node":">=8.x"},"gitHead":"3d68b342e525be86d5b1a98be73a9e364d80529b","scripts":{"lint":"eslint src/ docs/examples/ --ext .tsx,.ts,.jsx,.js","test":"rc-test","build":"dumi build","start":"dumi dev","compile":"father build && npm run compile:style","coverage":"father test --coverage","now-build":"npm run build","docs:deploy":"gh-pages -d .doc","compile:style":"lessc --js assets/index.less assets/index.css","prepublishOnly":"npm run lint && npm run test && npm run compile && np --yolo --no-publish --branch=antd-5.x"},"_npmUser":{"name":"afc163","email":"afc163@gmail.com"},"repository":{"url":"git+ssh://git@github.com/react-component/tabs.git","type":"git"},"_npmVersion":"10.8.3","description":"tabs ui component for react","directories":{},"_nodeVersion":"22.8.0","dependencies":{"rc-menu":"~9.16.0","rc-util":"^5.34.1","rc-motion":"^2.6.2","classnames":"2.x","rc-dropdown":"~4.2.0","@babel/runtime":"^7.11.2","rc-resize-observer":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"np":"^10.0.2","dumi":"^2.0.0","less":"^4.1.3","react":"^18.0.0","eslint":"^8.54.0","father":"^4.0.0","history":"^5.3.0","rc-test":"^7.0.14","gh-pages":"^6.1.0","coveralls":"^3.0.6","cross-env":"^7.0.2","fastclick":"~1.0.6","react-dnd":"^10.0.0","react-dom":"^18.0.0","sortablejs":"^1.7.0","typescript":"^5.3.2","@types/jest":"^29.4.0","@types/keyv":"4.2.0","@types/react":"^18.2.42","react-sticky":"^6.0.3","@types/enzyme":"^3.10.5","@umijs/fabric":"^4.0.1","preact-compat":"^3.16.0","@types/react-dom":"^18.0.11","@types/classnames":"^2.2.10","eslint-plugin-jest":"^28.9.0","immutability-helper":"^3.0.1","@rc-component/trigger":"^2.0.0","eslint-plugin-unicorn":"^56.0.1","@testing-library/react":"^16.0.1","react-dnd-html5-backend":"^10.0.0","@testing-library/jest-dom":"^6.1.4","@rc-component/father-plugin":"^1.0.0","@testing-library/user-event":"^14.5.2"},"peerDependencies":{"react":">=16.9.0","react-dom":">=16.9.0"},"_npmOperationalInternal":{"tmp":"tmp/rc-tabs_15.5.2_1743495522901_0.27864713799453655","host":"s3://npm-registry-packages-npm-production"},"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\n## Screenshot\n\n<img src='https://zos.alipayobjects.com/rmsportal/JwLASrsOYJuFRIt.png' width='408'>\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) => {\n  console.log(key);\n};\n\nconst items = [\n  {\n    key: '1',\n    label: 'Google',\n    children: (\n      <div className=\"text-xl\">\n        <p>Lorem Ipsum is simply dummy text of the printing and typesetting</p>\n      </div>\n    ),\n  },\n  {\n    key: '2',\n    label: <p>Amazon</p>,\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: <p>Twitter</p>,\n    children: (\n      <div>\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      </div>\n    ),\n  },\n];\n\nReactDom.render(\n  <Tabs\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  />,\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) => 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| destroyInactiveTabPane | boolean | false | whether destroy inactive TabPane when change tab |\n| onChange | (key) => void | - | called when tabPanel is changed |\n| onTabClick | (key) => void | - | called when tab click |\n| onTabScroll | ({ direction }) => 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| destroyInactiveTabPane | 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\n### TabPane(support in older versions)\n\n| name | type | default | description |\n| --- | --- | --- | --- |\n| destroyInactiveTabPane | 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:\n![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).\nIf enconter the third case, in order to make tabs responsive, some tabs should be hidden. \nSo we minus `addSize` when calculating `basicSize` manully, even though there's no addNode in container.\nIn this way, case 3 turns to case 2, tabs become stable again.\n","publish_time":1743495523110,"_cnpm_publish_time":1743495523110,"dist-tags":{"beta":"10.0.0-alpha.1","latest":"15.7.0"}}