Skip to content
Drag

Overview

Drag lets people move things in your interface with a mouse, a finger, a pen or the keyboard. Use it to reorder a list, carry an item between columns, or move a box across a grid.

The engine is written in TypeScript and works without a framework. Your app owns the data and commits each change when the person drops it.

Install Drag, try the sortable demo, or try Play.

You are buildingStart withWhat it does
A sortable list or columnsSortableMoves a preview, makes room between items, scrolls at the edges and supports keyboard dragging.
A React interfaceReactA provider and ref hooks over the same sortable engine.
A diagram or a canvas on squaresGridReports gestures in grid coordinates; you draw the movement and save the result.
A small HTML listWeb ComponentsCustom elements that reorder their own children.
Native browser drag eventsElement adapterSources, drop targets and monitors with typed lifecycle events.

Drag is MIT licensed. The sortable motion carries over behavior from @hello-pangea/dnd; its attribution is in NOTICE. React is optional. The framework-neutral entry points do not need it.

These guides follow the current source. See installation and versions before choosing between the published alpha and a source build.