Socket
Book a DemoInstallSign in
Socket

@deuex-solutions/react-dnd-nestable

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@deuex-solutions/react-dnd-nestable

*Note: this project is unmaintained.*

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

React DnD Nestable

Note: this project is unmaintained.

This was an attempt at a React DnD reimplementation of the excellent but dated Nestable jQuery plugin. Basic functionality should work, though feature parity with Nestable was never quite reached.

Demos

What does it look like?

<Nestable
  items={ this.state.items }
  renderItem={ this.renderItem }
  onUpdate={ this.updateItems }
  maxDepth={ 3 }
/>

Props

items

Required. Each item in the array must have a unique id property. This is used to keep track of which item is which.

Example: { id: '1', text: 'Item #1', children: [] }

renderItem

Required. A function which returns a React component. Invoked with an object containing the following properties:

PropertyDescription
itemThe item to render.
isDraggingWhether the item is currently being dragged.
isPreviewWhether the item is the preview drag layer.
depthThe current depth level.
connectDragSourceOnly available if props.useDragHandle is set to true. Use as specified in the React DnD docs.

childrenProperty

Optional. The property on each item which contains an array of children. Defaults to 'children'.

childrenStyle

Optional. Style object applied to nested <ol>s.

onUpdate

Optional. A function invoked with the new array of items whenever an item is dropped in a new location.

useDragHandle

Optional. Set to true to specify a drag handle. Otherwise, entire item is draggable. Defaults to false.

maxDepth

Optional. Maximum item depth. Defaults to Infinity.

threshold

Optional. Distance in pixels the cursor must move horizontally before item changes depth. Defaults to 30.

Keywords

react

FAQs

Package last updated on 08 Nov 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts