JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q21477F
  • License MIT

simple drag and drop lib built using xstate and typescript

Package Exports

  • tug.js
  • tug.js/dist/index.js
  • tug.js/dist/index.mjs

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (tug.js) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

tug.js

Usage

Init drag and drop for dom nodes

<div class="dragable">drag me!</div>
<div class="dragable">or me!</div>
<div class="dropable">drop zone</div>
<div class="dropable dragable">dragable drop zone</div>
import { Tug } from "tug.js";

Tug.makeDragable({ selector: '.dragable', onDrop: (element) => {
    console.log('i just got dropped', element);
}});

Tug.makeDropable({ selector: '.dropable' });