Gathering detailed insights and metrics for dw-neit-rc-collapse
Gathering detailed insights and metrics for dw-neit-rc-collapse
Gathering detailed insights and metrics for dw-neit-rc-collapse
Gathering detailed insights and metrics for dw-neit-rc-collapse
npm install dw-neit-rc-collapse
Typescript
Module System
Node Version
NPM Version
65.4
Supply Chain
91.7
Quality
75.9
Maintenance
100
Vulnerability
100
License
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
Minified
Minified + Gzipped
Latest Version
3.7.3
Package Id
dw-neit-rc-collapse@3.7.3
Unpacked Size
49.69 kB
Size
9.20 kB
File Count
28
NPM Version
10.7.0
Node Version
18.20.4
Published on
Aug 16, 2024
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
dw-neit-rc-collapse ui component for react
http://react-component.github.io/collapse/
1var Collapse = require('dw-neit-rc-collapse'); 2var Panel = Collapse.Panel; 3var React = require('react'); 4var ReactDOM = require('react-dom'); 5require('dw-neit-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 | |
style | object | custom style | |
openMotion | object | set the animation of open behavior, [more](https://github.com/react-component/motion). Different with v2, closed pane use a `dw-neit-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
dw-neit-rc-collapse is released under the MIT license.
No vulnerabilities found.
No security vulnerabilities found.