Skip to content
SortableExamples

Svelte — Transfer between two lists

comins-sortable@0.1.6Svelte

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.

Pass the same scope from createSortableScope<Item>() to both use:sortable actions. Without it, each action owns an independent scope and cannot transfer between the lists. Commit arrays in onItemsChange and destroy the shared scope on disposal.

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 · Svelte guide