Shopify/draggable — reverse-engineered prompt

Reverse engineered prompt

GitHub

Build me a small drag and drop JavaScript library like Shopify Draggable. I want it to let developers make items draggable in the browser without fighting the raw browser events.

It should support mouse, touch, native drag, and force touch where possible. Include simple modules for sortable lists, dropping items into containers, and swapping items with each other. When dragging, it should create a mirror or preview of the item, fire useful lifecycle events, and let developers plug into those events to customize behavior.

Please include clear examples so I can open a demo page and try dragging cards between lists, sorting a list, and swapping tiles. Keep the API clean and modern, with ES module imports and TypeScript definitions. Add basic tests and documentation for the main classes and events. Make it work in current major browsers.

Use the current docs online if you need to check expected drag and drop behavior.

Want more depth? Deep Reverse