// the find
knadh/dragmove.js
A super tiny Javascript library to make DOM elements draggable and movable. ~500 bytes (minified+gzipped) and no dependencies.
A ~500-byte JS utility that makes any DOM element draggable by binding a handle element to a target, with touch support baked in. Good fit for someone who wants drag-to-move on a modal, panel, or widget without pulling in a full drag-and-drop library like interact.js or Sortable.
Actually tiny — 500 bytes gzipped and zero dependencies is a real claim, not landing-page fluff, given the whole implementation is one file. Touch and mouse are unified behind the same API, so you don't write separate handlers for mobile. The API surface is minimal (target, handle, onStart, onEnd) which makes it trivial to audit or vendor directly into a project.
No bounds/constraint option — you can't restrict dragging to a parent container, which is usually the first thing you need past a toy demo. No destroy/cleanup method documented, so removing the target element in an SPA without unbinding first will leak listeners. No TypeScript types, and no tests anywhere in the repo, so you're trusting a single-file library with no visible regression protection. Last pushed April 2024 and 46 forks against 904 stars suggests it's mostly starred, not extended — you're on your own if you hit an edge case.