Dragging and dropping elements in web interfaces is one of those tasks frontend developers take on with a heavy sigh. The native browser HTML5 Drag and Drop API was designed in the desktop era and is still poorly suited for mobile touchscreens: the phantom drag image is hard to style, opacity behaves unpredictably, and animations for shifting neighboring items have to be written by hand.
In the React ecosystem, @dnd-kit has long been the recognized standard. For Vue, a developer going by ZiZIGY created the vue-dnd-kit port, which quickly racked up thousands of stars. Yet as projects grew, version 2 of the library hit an architectural dead end.
Instead of endless patches, the author made a radical call: scrap the old codebase completely and release the Vue DnD Kit library version 3.0 from scratch. Let's look at the breakdown on Habr and see how the new architecture works.
Version 2's Architectural Dead End: 57 Bugs, Layout Thrashing, and Broken TypeScript
Version 2 of the library suffered from overly low-level abstractions. Developers were handed basic makeDraggable and makeDroppable primitives. To build a plain sortable task list, you had to write dozens of lines of boilerplate: manually track indexes, listen to onDrop, call the suggestSort helper, mutate the array, and wrap items in <TransitionGroup> for any semblance of smoothness.
An audit of the codebase uncovered a whole heap of fundamental issues:
- $O(N^2)$ algorithmic complexity: finding the drop zone (droppable container) under the cursor was done by naively iterating over every registered element on the page. On every mouse-move frame,
getBoundingClientRect()was called, triggering forced geometry recalculation (layout thrashing) and dropping frame rates from 120 FPS to a choppy 25 FPS on long lists. - 57 hidden core defects: any
mouseupevent on the document reset globaluser-selectandtouch-actionCSS properties,activationDelayin milliseconds was mistakenly multiplied as seconds, and key generics in.d.tstype files quietly degraded intoany.
An attempt to build on top of someone else's low-level @dnd-kit/dom core failed: the external engine required imperative calls via move() and could not leverage native Vue 3.5+ reactivity. Only one path remained—writing a dedicated engine from scratch.
The Reactive Draft Concept: Why Business Data No Longer Suffers on Cancelled Gestures
The centerpiece architectural breakthrough of Vue DnD Kit 3.0 is the Reactive Draft State concept.
Previously, the library mutated the original array of items directly during a drag. As a user dragged a card over a list, elements swapped places in memory. Yet what happened if a finger slipped off the screen, the user pressed Escape, or they released the cursor over a forbidden zone? A rollback kicked in: the array had to be restored to its original state, causing UI flicker and redundant triggers on reactive watchers.
In the makeSortableList composable, the items array is a reactive draft:
- The original task array in your
refor Pinia Store stays completely untouched throughout the entire drag. - The library manipulates only the draft: neighboring cards part, animations preview the item's future position, while zero changes happen in business logic.
- If the gesture is cancelled, the draft resets instantly with no side effects.
- If the user confirms the drop, the final order is written atomically into business state.
Here is how concise a basic sortable list looks in Vue 3.5+:
<script setup lang="ts">
import { ref, useTemplateRef } from 'vue';
import { makeSortableList } from '@vue-dnd-kit/core';
interface Task {
id: string;
title: string;
}
const listRef = useTemplateRef<HTMLElement>('listRef');
const tasks = ref<Task[]>([
{ id: '1', title: 'Design PostgreSQL schema' },
{ id: '2', title: 'Set up Playwright BDD tests' },
{ id: '3', title: 'Update Claude Code variables' }
]);
// makeSortableList returns the items draft for rendering
const { items } = makeSortableList(listRef, {
items: tasks,
id: 'tasks-sortable-list'
});
</script>
<template>
<ul ref="listRef" class="task-list">
<li
v-for="task in items"
:key="task.id"
:data-dnd-id="task.id"
class="task-item"
>
{{ task.title }}
</li>
</ul>
</template>
Notice there is no <TransitionGroup> component and no manual calls to sorting helpers. The library tracks the DOM itself via useTemplateRef template refs and the data-dnd-id attribute.
Built-In Kinematics Without TransitionGroup: Kanban Boards and Trees Out of the Box
The second developer pain point is motion physics. Tuning smooth element sliding with the FLIP (First, Last, Invert, Play) algorithm usually took days of work.
In version 3.0, kinematics are built straight into the core:
- Shifting neighboring cards is computed mathematically without creating intermediate DOM nodes;
- Returning a card to its original spot when pressing
Escapehappens with smooth physical interpolation; - The engine automatically checks the system
prefers-reduced-motionsetting: if a user has reduced motion enabled, animations turn off immediately for comfort and accessibility.
To build Kanban boards, you no longer need hacks to synchronize events. You simply link lists with a single string group ID:
import { useTemplateRef } from 'vue';
import { makeSortableList } from '@vue-dnd-kit/core';
import { useKanbanStore } from '@/stores/kanban';
const kanbanStore = useKanbanStore();
const columnRef = useTemplateRef<HTMLElement>('columnRef');
const { items } = makeSortableList(columnRef, {
id: 'column-review',
group: 'project-kanban-board',
items: () => kanbanStore.columns['review'],
onDrop: (event) => {
event.preventDefault();
// Atomically update columns in the store
for (const [columnId, newItems] of event.result) {
kanbanStore.updateColumn(columnId, newItems);
}
}
});
On top of that, the library supports hierarchical trees out of the box: dragging a node to the right automatically changes its nesting level while respecting a configurable depth limit.
As we recently saw in our Vue and Nuxt ecosystem digest, moving frontend tools onto Vue 3.5's strict reactive primitives lets maintainers throw out megabytes of legacy code, making interfaces responsive and rock-solid.
Symbiosis with Claude Code: How AI Agents Helped Rewrite the Library from Scratch
The engineering process behind release 3.0 is also noteworthy. The author openly shares that the rewrite was done in tight collaboration with the Claude Code CLI agent:
- The agent ran a full audit of the old codebase, matched hundreds of open GitHub issues against the source code, and compiled the registry of those 57 critical bugs.
- The agent studied the architecture of competing solutions (Atlassian's Pragmatic Drag and Drop) and helped draft the technical RFC.
- In parallel terminal sessions, the agent generated dozens of edge-case stress tests: sudden mouse jerks off-screen, multi-touch on mobile devices, and behavior during active page scrolling.
Meanwhile, product decisions—public API design, dropping external dependencies, and draft semantics—remained in human hands.
Vue DnD Kit 3.0 clearly demonstrates how mature frontend engineering sheds years of workarounds, turning complex UI interactions into a few lines of clean declarative code.

![Node.JS [ru]](/api/digests/it_development/daily/20261105/assets/sources/we-use-js.jpg?v=dd82e88a7e726190393fcef7d544ee35baed63c81bf03d147365326a808ee3c1)