{"id":30580547,"url":"https://github.com/react-component/collapse","last_synced_at":"2025-08-29T05:36:59.480Z","repository":{"id":34068598,"uuid":"37856407","full_name":"react-component/collapse","owner":"react-component","description":"React Collapse / Accordion","archived":false,"fork":false,"pushed_at":"2025-08-12T05:58:31.000Z","size":2196,"stargazers_count":330,"open_issues_count":32,"forks_count":139,"subscribers_count":26,"default_branch":"master","last_synced_at":"2025-08-22T09:24:12.807Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://collapse-react-component.vercel.app/","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":"HISTORY.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":"2015-06-22T13:23:05.000Z","updated_at":"2025-08-10T04:25:53.000Z","dependencies_parsed_at":"2023-02-10T18:15:53.208Z","dependency_job_id":"b786d299-62f1-4c61-96df-5cd637178c2f","html_url":"https://github.com/react-component/collapse","commit_stats":{"total_commits":224,"total_committers":51,"mean_commits":4.392156862745098,"dds":0.8214285714285714,"last_synced_commit":"c82db62d0a6000e449d4c7313aa8fa6a319276b2"},"previous_names":[],"tags_count":87,"template":false,"template_full_name":null,"purl":"pkg:github/react-component/collapse","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-component%2Fcollapse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-component%2Fcollapse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-component%2Fcollapse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-component%2Fcollapse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/react-component","download_url":"https://codeload.github.com/react-component/collapse/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-component%2Fcollapse/sbom","scorecard":{"id":765344,"data":{"date":"2025-08-11","repo":{"name":"github.com/react-component/collapse","commit":"bc63f6b245b3ad384cf9ee2e5514aa7057299ba4"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.9,"checks":[{"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":5,"reason":"7 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 5","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"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":"Code-Review","score":4,"reason":"Found 12/26 approved changesets -- score normalized to 4","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":"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/react-component-ci.yml:1","Warn: topLevel 'contents' permission set to 'write': .github/workflows/site-deploy.yml:9","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":"Pinned-Dependencies","score":2,"reason":"dependency not pinned by hash detected -- score normalized to 2","details":["Warn: third-party GitHubAction not pinned by hash: .github/workflows/react-component-ci.yml:5: update your workflow using https://app.stepsecurity.io/secureworkflow/react-component/collapse/react-component-ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/site-deploy.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/react-component/collapse/site-deploy.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/site-deploy.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/react-component/collapse/site-deploy.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/site-deploy.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/react-component/collapse/site-deploy.yml/master?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/site-deploy.yml:25","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned","Info:   1 out of   2 npmCommand 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":"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":"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":"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":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"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 19 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:36:56.367Z","repository_id":34068598,"created_at":"2025-08-23T00:36:56.367Z","updated_at":"2025-08-23T00:36:56.367Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272636165,"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:54.420Z","updated_at":"2025-08-29T05:36:59.472Z","avatar_url":"https://github.com/react-component.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rc-collapse\n\nrc-collapse ui component for react\n\n[![NPM version][npm-image]][npm-url] [![build status][github-actions-image]][github-actions-url] [![Test coverage][codecov-image]][codecov-url] [![npm download][download-image]][download-url]\n\n[npm-image]: http://img.shields.io/npm/v/rc-collapse.svg?style=flat-square\n[npm-url]: http://npmjs.org/package/rc-collapse\n[github-actions-image]: https://github.com/react-component/collapse/workflows/CI/badge.svg\n[github-actions-url]: https://github.com/react-component/collapse/actions\n[codecov-image]: https://img.shields.io/codecov/c/github/react-component/collapse/master.svg?style=flat-square\n[codecov-url]: https://app.codecov.io/gh/react-component/collapse\n[download-image]: https://img.shields.io/npm/dm/rc-collapse.svg?style=flat-square\n[download-url]: https://npmjs.org/package/rc-collapse\n\n## Live Demo\n\nhttps://collapse-react-component.vercel.app\n\n## Install\n\n[![rc-collapse](https://nodei.co/npm/rc-collapse.png)](https://npmjs.org/package/rc-collapse)\n\n## Usage\n\n```js\nvar Collapse = require('rc-collapse');\nvar Panel = Collapse.Panel;\nvar React = require('react');\nvar ReactDOM = require('react-dom');\nrequire('rc-collapse/assets/index.css');\n\nvar App = (\n  \u003cCollapse accordion={true}\u003e\n    \u003cPanel header=\"hello\" headerClass=\"my-header-class\"\u003e\n      this is panel content\n    \u003c/Panel\u003e\n    \u003cPanel header=\"title2\"\u003ethis is panel content2 or other\u003c/Panel\u003e\n  \u003c/Collapse\u003e\n);\nReactDOM.render(App, container);\n```\n\n## Features\n\n- support ie8,ie8+,chrome,firefox,safari\n\n## API\n\n### Collapse props\n\n\u003ctable class=\"table table-bordered table-striped\"\u003e\n    \u003cthead\u003e\n    \u003ctr\u003e\n        \u003cth style=\"width: 100px;\"\u003ename\u003c/th\u003e\n        \u003cth style=\"width: 50px;\"\u003etype\u003c/th\u003e\n        \u003cth\u003edefault\u003c/th\u003e\n        \u003cth\u003edescription\u003c/th\u003e\n    \u003c/tr\u003e\n    \u003c/thead\u003e\n    \u003ctbody\u003e\n      \u003ctr\u003e\n          \u003ctd\u003eactiveKey\u003c/td\u003e\n          \u003ctd\u003eString|Array\u003cString\u003e\u003c/td\u003e\n          \u003cth\u003eThe first panel key\u003c/th\u003e\n          \u003ctd\u003ecurrent active Panel key\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n        \u003ctd\u003eclassName\u003c/td\u003e\n        \u003ctd\u003eString or object\u003c/td\u003e\n        \u003cth\u003e\u003c/th\u003e\n        \u003ctd\u003ecustom className to apply\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n          \u003ctd\u003edefaultActiveKey\u003c/td\u003e\n          \u003ctd\u003eString|Array\u003cString\u003e\u003c/td\u003e\n          \u003cth\u003enull\u003c/th\u003e\n          \u003ctd\u003edefault active key\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n          \u003ctd\u003edestroyOnHidden\u003c/td\u003e\n          \u003ctd\u003eBoolean\u003c/td\u003e\n          \u003cth\u003efalse\u003c/th\u003e\n          \u003ctd\u003eIf destroy the panel which not active, default false. \u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n          \u003ctd\u003eaccordion\u003c/td\u003e\n          \u003ctd\u003eBoolean\u003c/td\u003e\n          \u003cth\u003efalse\u003c/th\u003e\n          \u003ctd\u003eaccordion mode, default is null, is collapse mode\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n          \u003ctd\u003eonChange\u003c/td\u003e\n          \u003ctd\u003eFunction(key)\u003c/td\u003e\n          \u003cth\u003enoop\u003c/th\u003e\n          \u003ctd\u003ecalled when collapse Panel is changed\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n          \u003ctd\u003eexpandIcon\u003c/td\u003e\n          \u003ctd\u003e(props: PanelProps) =\u003e ReactNode\u003c/td\u003e\n          \u003cth\u003e\u003c/th\u003e\n          \u003ctd\u003especific the custom expand icon.\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n          \u003ctd\u003ecollapsible\u003c/td\u003e\n          \u003ctd\u003e'header' | 'icon' | 'disabled'\u003c/td\u003e\n          \u003cth\u003e-\u003c/th\u003e\n          \u003ctd\u003especify whether the panel of children is collapsible or the area of collapsible.\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n          \u003ctd\u003eitems\u003c/td\u003e\n          \u003ctd\u003e\n            \u003ca href=\"./src/interface.ts#ItemType\"\u003einterface.ts#ItemType\u003c/a\u003e\n          \u003c/td\u003e\n          \u003cth\u003e-\u003c/th\u003e\n          \u003ctd\u003ecollapse items content\u003c/td\u003e\n      \u003c/tr\u003e\n    \u003c/tbody\u003e\n\u003c/table\u003e\n\nIf `accordion` is null or false, every panel can open. Opening another panel will not close any of the other panels. `activeKey` should be an string, if passing an array (the first item in the array will be used).\n\nIf `accordion` is true, only one panel can be open. Opening another panel will cause the previously opened panel to close. `activeKey` should be an string, if passing an array (the first item in the array will be used).\n\n### Collapse.Panel props\n\n\u003e **deprecated** use `items` instead, will be removed in `v4.0.0`\n\n\u003ctable class=\"table table-bordered table-striped\"\u003e\n    \u003cthead\u003e\n    \u003ctr\u003e\n        \u003cth style=\"width: 100px;\"\u003ename\u003c/th\u003e\n        \u003cth style=\"width: 200px;\"\u003etype\u003c/th\u003e\n        \u003cth\u003edefault\u003c/th\u003e\n        \u003cth\u003edescription\u003c/th\u003e\n    \u003c/tr\u003e\n    \u003c/thead\u003e\n    \u003ctbody\u003e\n      \u003ctr\u003e\n          \u003ctd\u003eheader\u003c/td\u003e\n          \u003ctd\u003eString or node\u003c/td\u003e\n          \u003cth\u003e\u003c/th\u003e\n          \u003ctd\u003eheader content of Panel\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n          \u003ctd\u003eheaderClass\u003c/td\u003e\n          \u003ctd\u003eString\u003c/td\u003e\n          \u003cth\u003e' '\u003c/th\u003e\n          \u003ctd\u003ecustom className to apply to header\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n          \u003ctd\u003eshowArrow\u003c/td\u003e\n          \u003ctd\u003eboolean\u003c/td\u003e\n          \u003cth\u003etrue\u003c/th\u003e\n          \u003ctd\u003eshow arrow beside header\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n        \u003ctd\u003eclassName\u003c/td\u003e\n        \u003ctd\u003eString or object\u003c/td\u003e\n        \u003cth\u003e\u003c/th\u003e\n        \u003ctd\u003ecustom className to apply\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n        \u003ctd\u003eclassNames\u003c/td\u003e\n        \u003ctd\u003e{ header?: string, body?: string }\u003c/td\u003e\n        \u003cth\u003e\u003c/th\u003e\n        \u003ctd\u003eSemantic structure className\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n        \u003ctd\u003estyle\u003c/td\u003e\n        \u003ctd\u003eobject\u003c/td\u003e\n        \u003cth\u003e\u003c/th\u003e\n        \u003ctd\u003ecustom style\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n        \u003ctd\u003estyles\u003c/td\u003e\n        \u003ctd\u003e{ header?: React.CSSProperties, body?: React.CSSProperties }\u003c/td\u003e\n        \u003cth\u003e\u003c/th\u003e\n        \u003ctd\u003eSemantic structure styles\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n        \u003ctd\u003eopenMotion\u003c/td\u003e\n        \u003ctd\u003eobject\u003c/td\u003e\n        \u003cth\u003e\u003c/th\u003e\n        \u003ctd\u003eset the animation of open behavior, [more](https://github.com/react-component/motion). Different with v2, closed pane use a `rc-collapse-content-hidden` class to set `display: none` for hidden.\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n        \u003ctd\u003eforceRender\u003c/td\u003e\n        \u003ctd\u003eboolean\u003c/td\u003e\n        \u003cth\u003efalse\u003c/th\u003e\n        \u003ctd\u003eforced render of content in panel, not lazy render after clicking on header\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n          \u003ctd\u003eextra\u003c/td\u003e\n          \u003ctd\u003eString | ReactNode\u003c/td\u003e\n          \u003cth\u003e\u003c/th\u003e\n          \u003ctd\u003eContent to render in the right of the panel header\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n          \u003ctd\u003ecollapsible\u003c/td\u003e\n          \u003ctd\u003e'header' | 'icon' | 'disabled'\u003c/td\u003e\n          \u003cth\u003e-\u003c/th\u003e\n          \u003ctd\u003especify whether the panel be collapsible or the area of collapsible.\u003c/td\u003e\n      \u003c/tr\u003e\n    \u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003e `disabled` is removed since 3.0.0, please use `collapsible=disabled` replace it.\n\n#### key\n\nIf `key` is not provided, the panel's index will be used instead.\n\n#### KeyBoard Event\n\nBy default, Collapse will listen `onKeyDown`(\u003c3.7.0 `onKeyPress`) event with `enter` key to toggle panel's active state when `collapsible` is not `disabled`. If you want to disable this behavior, you can prevent the event from bubbling like this:\n\n```tsx | pure\nconst App = () =\u003e {\n  const items: CollapseProps['items'] = [\n    {\n      label: \u003cinput onKeyDown={(e) =\u003e e.stopPropagation()} /\u003e,\n      children: 'content',\n    },\n    {\n      label: (\n        \u003cdiv onKeyDown={(e) =\u003e e.stopPropagation()}\u003e\n          \u003cCustomComponent /\u003e\n        \u003c/div\u003e\n      ),\n      children: 'content',\n    },\n    {\n      label: 'title 2',\n      children: 'content 2',\n      collapsible: 'disabled',\n    },\n    {\n      label: 'title 3',\n      children: 'content 3',\n      onItemClick: console.log,\n    },\n  ];\n\n  return \u003cCollapse items={items} /\u003e;\n};\n```\n\n## Development\n\n```bash\nnpm install\nnpm start\n```\n\n## Test Case\n\n```bash\nnpm test\n```\n\n## Coverage\n\n```bash\nnpm test -- --coverage\n```\n\n## License\n\nrc-collapse is released under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freact-component%2Fcollapse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freact-component%2Fcollapse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freact-component%2Fcollapse/lists"}