JavaScript drag and drop, resizing, and multi-touch gestures for modern browsers (and also IE9+)

  • Free and open source
  • Powerful snap and restriction modifiers
  • Inertial throwing
  • Multiple simultaneous interactions
  • Unified API for touch and mouse events
  • Auto scroll
  • Support for HTML and SVG
 
Features
  • Free and open source
  • Powerful snap and restriction modifiers
  • Inertial throwing
  • Multiple simultaneous interactions
  • Unified API for touch and mouse events
  • Auto scroll
  • Support for HTML and SVG
How does it work?

interact.js takes a slightly different approach compared to most drag and drop libraries. To give you as much control as possible, it tries to provide a simple, flexible API that gives you all the pointer event data you'll need to move elements around.

The library doesn't even do any moving at all! This is great because you decide exactly what feedback your users get. You can drag elements, draw on a canvas or (if you really need to) scroll the page.

Have a look at the demos below to get an idea of how the API works, or read through the documentation.

Here's a simple pixel drawing app with interact.js


Dragging

Drag and drop

Snapping

Resizing

Multi-touch Rotation (touchscreen only)

Pinch-to-zoom (touchscreen only)

Use in SVG files

Tap, doubletap and hold