Skip to main content

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 a plugins function to DragDropProvider:
Use the function form (defaults) => [...] to extend the default plugins rather than replacing them. Passing a plain array replaces all default plugins, which may disable expected behavior like auto-scrolling and accessibility.

Per-draggable feedback

Configure feedback on individual elements via the plugins option in useDraggable or useSortable:

Feedback modes

The feedback option controls how the element behaves during drag:

Drop animations

Disabling the drop animation

Customizing the drop animation

Custom animation function

For full control, provide a function that returns a Promise:

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:
Or ensure your state update matches the final position by using the 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.