Gathering detailed insights and metrics for react-nestable-fork
Gathering detailed insights and metrics for react-nestable-fork
Gathering detailed insights and metrics for react-nestable-fork
Gathering detailed insights and metrics for react-nestable-fork
npm install react-nestable-fork
Typescript
Module System
Node Version
NPM Version
46.4
Supply Chain
89.5
Quality
73.9
Maintenance
50
Vulnerability
99.6
License
JavaScript (90.63%)
CSS (5.02%)
Stylus (3.78%)
HTML (0.56%)
Total Downloads
3,381
Last Day
1
Last Week
1
Last Month
11
Last Year
89
80 Commits
1 Watching
4 Branches
1 Contributors
Minified
Minified + Gzipped
Latest Version
1.3.0
Package Id
react-nestable-fork@1.3.0
Unpacked Size
90.04 kB
Size
19.36 kB
File Count
35
NPM Version
6.14.11
Node Version
10.24.0
Cumulative downloads
Total Downloads
Last day
0%
1
Compared to previous day
Last week
0%
1
Compared to previous week
Last month
266.7%
11
Compared to previous month
Last year
-85.7%
89
Compared to previous year
32
npm install -save react-nestable
import Nestable from 'react-nestable';
every item must have a unique id
in order to distinguish elements
const items = [
{ id: 0, text: 'Andy' },
{
id: 1, text: 'Harry',
children: [
{ id: 2, text: 'David' }
]
},
{ id: 3, text: 'Lisa' }
];
const renderItem = ({ item }) => item.text;
const Example = () => (
<Nestable
items={items}
renderItem={renderItem}
/>
)
Property | Type | Default | Description |
---|---|---|---|
className | string | undefined | Extra class name which can be passed to a root element. |
items | array | [] | Array of items. Every item must be of shape { id: @uniq } . |
threshold | int | 30 | Amount of pixels which mouse should move horizontally before increasing/decreasing level (nesting) of current element. |
maxDepth | int | 10 | Maximum available level of nesting. |
collapsed | boolean | false | Are groups collapsed by default. |
group | string or int | random string | Different group numbers may be passed if you have more than one nestable component on a page and want some extra styles for portal instances. |
handler | component | If you pass react component here, you may use it in your render method. | |
childrenProp | string | "children" | Optional name of property with children. |
renderItem | function | ({ item, index }) => item.toString() | Function for rendering every item. Has a single parameter with keys: item - item from your array, index - index of the item, collapseIcon - icon for items with children (allows you to collapse group), handler - component which you have passed via the same property, but covered with some additional events. |
renderCollapseIcon | function | ({ isCollapsed }) => <DefaultIcon /> | Function for rendering collapse icon. Has a single parameter with keys: isCollapsed - boolean, true if this group has children and collapsed. |
onChange | function | () => {} | Callback which has two parameters: items - new array after position was changed, item - item which has been moved. |
confirmChange | function | () => true | Callback which has two parameters: dragItem - item which is being dragged, destinationParent - item where dragItem is about to land. Let function return false if this movement should not happen. |
Method | Accepts | Description |
---|---|---|
collapse | string or array | "NONE" - expand all groups; "ALL" - collapse all groups; [] - collapse all groups with ids from given array |
PS: Please, make an issue or create a PR if you need any more functionality.
ISC
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
no SAST tool detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
79 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-12-16
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