Skip to content
SortableExamples

React — Transfer between two lists

comins-sortable@0.1.6React

Reorder items within one list or transfer them to another. Both areas share one scope and group="tasks", with unique areaId values. Item IDs remain stable during transfer.

Drag the left handle into the empty list on the right. The done count increases and the item leaves the first list. Reset returns all items to their original order. Transfer in this example uses pointer interaction.

SortableRoot owns the shared scope. Connect items, itemKey, and onItemsChange on each SortableArea. Commit each list array from its callback during transfer. children(item, index) is a render prop returning a React element. This contract is distinct from the same-named Vue components.

Handles use touch-action: none and user-select: none to avoid competing touch scroll and text selection during a drag.

Transfer, move between lists, drag and drop, reorder, shared scope.

npm 0.1.6 · React guide