Skip to main content

Overview

The @dnd-kit/dom package provides a complete DOM-based implementation of the dnd-kit drag-and-drop framework. It includes built-in sensors for pointer and keyboard interactions, plugins for accessibility and visual feedback, and high-level primitives for common use cases.

Installation

Core Exports

DragDropManager

The main orchestrator for drag-and-drop operations.
See DragDropManager for detailed documentation.

Entities

  • Draggable - Makes elements draggable
  • Droppable - Makes elements drop targets
  • Sortable - Combines draggable and droppable for sortable lists

Sensors

See Sensors for detailed documentation.

Plugins

See Plugins for detailed documentation.

Default Preset

The DragDropManager includes a default preset with recommended sensors and plugins:
This preset is automatically applied unless you override it:

Events

The manager emits events throughout the drag lifecycle:

Event Types

  • beforedragstart - Before drag initialization
  • dragstart - Drag operation started
  • dragmove - Draggable position changed
  • dragover - Dragging over a droppable
  • collision - Collision detected with droppable
  • dragend - Drag operation ended

Basic Example

Package Exports

Additional Exports

The package also provides additional exports for specific use cases:
  • /sortable - Sortable list primitives
  • /modifiers - Position and constraint modifiers
  • /utilities - DOM utilities and helpers
  • /plugins/debug - Debug visualization plugin

Next Steps

DragDropManager

Configure the drag-and-drop manager

Sensors

Configure pointer and keyboard sensors

Plugins

Extend functionality with plugins

Sortable

Build sortable lists