Interactive Demo

Drag between trees with configurable drop zones

Demo
Source (drag from here)
Target (drop here) - Trash only accepts 'child'
Controls
Features
Drop Positions
  • above - Insert as sibling before
  • below - Insert as sibling after
  • child - Insert as child
Key Props
  • drop-zone-mode - 'glow' | 'floating'
  • allow-copy - Enable Ctrl+drag
  • order-member - Sibling sort order
Touch Support

Long-press (300ms) to drag on mobile.

Advanced Features

Restricted positions, async callbacks, and dynamic rules

Demo
Try: Trash = child only | Folder = all | File = above/below only
Code
Restricted Positions & Async
 
Details
allowedDropPositions

Restrict which positions are valid per node:

  • ['child'] - Trash folders
  • ['above', 'below'] - Files (no nesting)
  • undefined - All allowed (default)
Two Ways to Set
  • allowed-drop-positions-member - Static from data
  • getAllowedDropPositionsCallback - Dynamic logic (JS property)
beforeDropCallback

Async validation before drop. Return false to cancel, or modify position/operation.

API Reference

All drag & drop related properties

Properties
Attribute / PropertyTypeDescription
drop-zone-mode'glow' | 'floating'Visual style for drop indicators
drop-zone-layoutstringFloating layout: around, above, below, wave, wave2
allow-copybooleanEnable Ctrl+drag to copy
auto-handle-copybooleanAuto-handle same-tree copy (default: true)
drag-drop-modestringnone | self | cross | both
order-memberstringData property for sibling sort order
allowed-drop-positions-memberstringData property for allowed positions array
getAllowedDropPositionsCallbackfunctionDynamic allowed positions per node (JS only)
Events
EventDetail Properties
node-drag-startnode, event
node-drag-overnode, event
beforeDropCallback(dropNode, draggedNode, position, event, operation) - JS property
node-dropdropNode, draggedNode, position, event, operation
Position: 'above' | 'below' | 'child'
Operation: 'move' | 'copy'
Data Properties
Data PropertyTypeDescription
isDraggablebooleanCan this node be dragged?
isDropAllowedbooleanCan drop on this node?
allowedDropPositionsDropPosition[]['above', 'below', 'child']
Tip: Use is-draggable-member and is-drop-allowed-member attributes to map custom property names.