Overview
The Feedback plugin manages visual feedback during drag operations. It is included by default and handles element promotion to the browser’s top layer and drop animations. This guide covers common React patterns and troubleshooting.Configuring feedback globally
To configure feedback for all draggable elements, pass aplugins function to DragDropProvider:
Per-draggable feedback
Configure feedback on individual elements via theplugins option in useDraggable or useSortable:
Feedback modes
Thefeedback option controls how the element behaves during drag:
| Mode | Behavior |
|---|---|
'default' | The element is promoted to the top layer and moves with the pointer |
'clone' | A clone of the element stays in its original position while the original moves |
'move' | The element moves without top layer promotion or a placeholder |
'none' | No visual feedback from the Feedback plugin. Use this when rendering a custom DragOverlay |
Drop animations
Disabling the drop animation
Customizing the drop animation
Custom animation function
For full control, provide a function that returns aPromise:
Troubleshooting
Duplicate items after data refetch
When using sortable lists with React Query or other data fetching libraries, you may see duplicate items after a refetch. This happens because the OptimisticSortingPlugin has moved DOM elements during the drag, and the refetched data renders new elements in the updated positions. See Integration with external state for how to solve this by deferring state sync until the drag is complete.Double animation or snap on drop
If items snap into position twice after dropping, your state update is likely conflicting with the drop animation. The Feedback plugin animates the element back, then your state update triggers a re-render that moves it again. To fix this, disable the drop animation:move helper from @dnd-kit/helpers in onDragEnd, which correctly reconciles the optimistic position with your state.
For the complete API reference including
rootElement and keyboardTransition options, see the core Feedback plugin documentation.