DevExtreme v24.2 is now available.

Explore our newest features/capabilities and share your thoughts with us.

Your search did not match any results.

React List - Item Drag & Drop

This demo shows how to enable item drag and drop in the List component. You can reorder items or drag and drop them between two separate lists. Use the handles on the right side of items to initiate drag and drop.

To give you the ability to edit code on the fly, the demo uses SystemJS. For this reason, launching the demo takes some time. We strongly recommend that you do not use this approach in real projects.
Backend API

The following steps describe how to configure this functionality:

  1. Enable item drag and drop
    Set the itemDragging.allowReordering to true.

  2. Add the lists to the same group
    Set the group property of both components to the same value to allow a user to drag and drop items between them.

  3. Reorder list items in code
    Use the onDragStart event handler to store the dragged item's data. When a user drops the item, the onRemove and onAdd functions allow you to remove the item from its initial position and add it to the new location.