tug.js
v0.0.3
Published
simple drag and drop lib built using xstate and typescript
Downloads
199
Maintainers
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' });