dnd kit Extensible drag-and-drop toolkit with a framework-agnostic core and framework adapters.
Overview dnd kit is an open-source toolkit for building drag-and-drop interfaces. Its current architecture separates a framework-independent core, a DOM implementation and adapters for UI frameworks. It supports draggable elements, drop targets and sortable collections while leaving the application's content, styling and persisted data model to its integration.[1]
Contents Integration building blocks React integration now uses @dnd-kit/react. Draggable and droppable hooks associate unique IDs with DOM references, and DragDropProvider coordinates operations and exposes events. The helpers package supplies array-moving utilities for sorting. This allows an application to compose interactions around its own elements rather than adopting a finished task-board product. Actual data movement is handled in application event logic.[2]
Do not mix API generations The current migration guide replaces the legacy DndContext with DragDropProvider. Event data changes from active and over to operation.source and operation.target; cancellation is handled through event.canceled inside onDragEnd. Current sortable imports and sensor configuration also differ. A project receiving generated snippets should first establish which package family it uses. Merely changing an import without reconciling event handling and sortable state is not the documented migration.[3]
Optimistic sorting and saved order The default OptimisticSortingPlugin reorders DOM elements during dragging. Under that behavior, source and target can refer to the same element, so comparing their IDs is not a reliable way to discover the movement. The documentation instead uses initialIndex/index and initialGroup/group after narrowing with isSortable, or the move helper. The application must reconcile its state with the completed operation and handle cancellation. A visually reordered list alone does not establish that the underlying data or a remote database changed.[4]
Keyboard and accessible interactions A keyboard sensor is enabled by default. It activates from the focused draggable element or handle and normally avoids starting a drag from focused descendant inputs or buttons. Bindings use KeyboardEvent.key values, which is important for keyboard layouts and older configurations based on physical key codes. The repository also documents ARIA defaults, screen-reader instructions and live regions. These are integration aids; the final interface still needs testing with its actual handles, controls and announcements.[1] [5]
License and deployment scope The repository is MIT-licensed with its notice requirements. It can be incorporated into commercial web applications without a toolkit subscription implied by that license. Application hosting, persistence and operational behavior remain separate from the permission to reuse the library.[6]
Substitution considerations dnd kit can substitute for SortableJS in list and grid reordering workflows when its framework adapters and extensibility fit the project. SortableJS offers a direct list-oriented integration, while dnd kit exposes a broader manager, sensor and interaction model. This is a choice of implementation architecture rather than drop-in API compatibility. The comparison is documentation-based; no installation or interaction benchmark was performed.[1] [7]
Also included: 4 capabilities and 0 substitute relationships. Check substitutes in section 1 and capabilities in section 3.