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
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
324 Stars
291 Commits
134 Forks
28 Watching
11 Branches
60 Contributors
Updated on 13 Nov 2024
Minified
Minified + Gzipped
TypeScript (93.43%)
Less (5.14%)
JavaScript (1.43%)
Cumulative downloads
Total Downloads
Last day
-6.7%
284,393
Compared to previous day
Last week
2.6%
1,513,618
Compared to previous week
Last month
10.7%
6,264,598
Compared to previous month
Last year
19.6%
65,118,745
Compared to previous year
4
24
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
6 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 5
Reason
Found 8/19 approved changesets -- score normalized to 4
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
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 2024-11-18
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