DEV Community

Cover image for dnd-manager: Lightweight Drag and Drop for Vanilla JS
jQueryScript
jQueryScript

Posted on

dnd-manager: Lightweight Drag and Drop for Vanilla JS

dnd-manager: a vanilla JavaScript library for data-driven drag-and-drop that works with any framework.

Key features:

  • Callback-based API: reads positions and item data from HTML data attributes
  • Supports vanilla JS, React, and any other framework
  • Includes a DragPreviewController that clones the dragged element and tracks the cursor
  • Multiple manager instances for cross-container drag operations
  • Dynamic canDrag support for per-item permission control at pointer-down time
  • Uses Pointer Events API (touch, mouse, and pen)

👉 Blog Post

👉 GitHub Repo

👉 Live Demo

Top comments (0)