Gathering detailed insights and metrics for rc-collapse
Gathering detailed insights and metrics for rc-collapse
Gathering detailed insights and metrics for rc-collapse
Gathering detailed insights and metrics for rc-collapse
npm install rc-collapse
Typescript
Module System
Node Version
NPM Version
TypeScript (93.63%)
Less (4.98%)
JavaScript (1.39%)
Total Downloads
263,058,581
Last Day
250,851
Last Week
1,541,863
Last Month
6,716,327
Last Year
72,615,908
MIT License
328 Stars
298 Commits
138 Forks
27 Watchers
11 Branches
61 Contributors
Updated on Apr 04, 2025
Minified
Minified + Gzipped
Latest Version
4.0.0
Package Id
rc-collapse@4.0.0
Unpacked Size
52.19 kB
Size
9.59 kB
File Count
28
NPM Version
10.8.2
Node Version
22.5.1
Published on
Jan 07, 2025
Cumulative downloads
Total Downloads
Last Day
22.3%
250,851
Compared to previous day
Last Week
8.3%
1,541,863
Compared to previous week
Last Month
-4.3%
6,716,327
Compared to previous month
Last Year
25.1%
72,615,908
Compared to previous year
4
25
rc-collapse ui component for react
https://collapse-react-component.vercel.app
1var Collapse = require('rc-collapse'); 2var Panel = Collapse.Panel; 3var React = require('react'); 4var ReactDOM = require('react-dom'); 5require('rc-collapse/assets/index.css'); 6 7var App = ( 8 <Collapse accordion={true}> 9 <Panel header="hello" headerClass="my-header-class"> 10 this is panel content 11 </Panel> 12 <Panel header="title2">this is panel content2 or other</Panel> 13 </Collapse> 14); 15ReactDOM.render(App, container);
name | type | default | description |
---|---|---|---|
activeKey | String|Array | The first panel key | current active Panel key |
className | String or object | custom className to apply | |
defaultActiveKey | String|Array | null | default active key |
destroyInactivePanel | Boolean | false | If destroy the panel which not active, default false. |
accordion | Boolean | false | accordion mode, default is null, is collapse mode |
onChange | Function(key) | noop | called when collapse Panel is changed |
expandIcon | (props: PanelProps) => ReactNode | specific the custom expand icon. | |
collapsible | 'header' | 'icon' | 'disabled' | - | specify whether the panel of children is collapsible or the area of collapsible. |
items | interface.ts#ItemType | - | collapse items content |
If 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).
If 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).
deprecated use
items
instead, will be removed inv4.0.0
name | type | default | description |
---|---|---|---|
header | String or node | header content of Panel | |
headerClass | String | ' ' | custom className to apply to header |
showArrow | boolean | true | show arrow beside header |
className | String or object | custom className to apply | |
classNames | { header?: string, body?: string } | Semantic structure className | |
style | object | custom style | |
styles | { header?: React.CSSProperties, body?: React.CSSProperties } | Semantic structure styles | |
openMotion | object | set 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. | |
forceRender | boolean | false | forced render of content in panel, not lazy render after clicking on header |
extra | String | ReactNode | Content to render in the right of the panel header | |
collapsible | 'header' | 'icon' | 'disabled' | - | specify whether the panel be collapsible or the area of collapsible. |
disabled
is removed since 3.0.0, please usecollapsible=disabled
replace it.
If key
is not provided, the panel's index will be used instead.
By default, Collapse will listen onKeyDown
(<3.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:
1const App = () => { 2 const items: CollapseProps['items'] = [ 3 { 4 label: <input onKeyDown={(e) => e.stopPropagation()} />, 5 children: 'content', 6 }, 7 { 8 label: ( 9 <div onKeyDown={(e) => e.stopPropagation()}> 10 <CustomComponent /> 11 </div> 12 ), 13 children: 'content', 14 }, 15 { 16 label: 'title 2', 17 children: 'content 2', 18 collapsible: 'disabled', 19 }, 20 { 21 label: 'title 3', 22 children: 'content 3', 23 onItemClick: console.log, 24 }, 25 ]; 26 27 return <Collapse items={items} />; 28};
1npm install 2npm start
1npm test
1npm test -- --coverage
rc-collapse is released under the MIT license.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 11/25 approved changesets -- score normalized to 4
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-05-05
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More