
Dnd-kit simplifies drag-and-drop in React and Next.js
A developer used dnd-kit to add sortable lists and draggable cards to a Next.js 14 app with a few lines of code, citing a lightweight 10 KB bundle and clean React-first API [DevTo].
The author of a recent dev.to post built a kanban-style board in a Next.js 14 project using dnd-kit, a 2.5k-star open-source library that ships a core package of ~9 KB gzipped and separate utilities for sortable lists, drag overlays, and keyboard interactions [dnd-kit Docs]. The implementation relied on dnd-kit's DndContext and SortableContext components. After installing @dnd-kit/core and @dnd-kit/sortable, the author added a useSortable hook to each card, wired the onDragEnd callback to a simple state update, and let Next.js's server-side rendering handle the initial markup. This resulted in roughly 120 lines of JavaScript, compared to a typical 300-line setup for older libraries like react-beautiful-dnd [DevTo]. The library's TypeScript definitions eliminated most runtime type errors, and the bundle size impact was measured at 0.8% of the total page payload. Dnd-kit's support for React 18 concurrent features and Next.js 14 edge runtime means that newer projects no longer need to maintain separate drag-and-drop stacks for client-only and server-rendered pages [dnd-kit Docs]. Teams can standardize on a single, lightweight dependency, reducing bundle bloat and security surface. The author credits dnd-kit's composable API for cutting integration time from days to hours. Because the library exposes a minimal set of primitives, teams can drop in drag-and-drop without refactoring existing state management layers. The post also describes using a large language model to generate the initial useSortable example, which compiled without modification and required only a single console log for debugging [DevTo].
Subscribe to the broadcast.
Daily digest of the day's most important tech news. No fluff. Engineering signal only.
// delivered via substack · double-opt-in confirmation


