Skip to main content
The DragDropManager is the heart of dnd-kit. It coordinates all aspects of drag and drop operations, manages entities, handles collisions, and provides the API for controlling drag operations.

Overview

Every drag and drop context requires a manager instance. The manager:
  • Maintains a registry of draggable and droppable entities
  • Coordinates sensors for input handling
  • Manages the current drag operation state
  • Computes collisions between draggables and droppables
  • Applies modifiers to transform coordinates
  • Orchestrates plugins for extended functionality
  • Emits events for monitoring drag operations

Creating a manager

Basic usage

This creates a manager with the default preset:
  • Sensors: PointerSensor, KeyboardSensor
  • Plugins: Accessibility, AutoScroller, Cursor, Feedback, PreventSelection
  • Modifiers: None by default

Custom configuration

You can customize the manager by providing configuration options:
Configuration options accept either a value (replaces defaults) or a function that receives defaults (allows extending).

Type signature

Configuration options

Sensors

Sensors detect and handle user input:
Replace defaults:
Extend defaults:

Plugins

Plugins extend functionality:
Configure a plugin:

Modifiers

Modifiers transform drag coordinates:

Renderer

The renderer handles visual updates:
By default, the manager uses requestAnimationFrame. You can provide a custom renderer for framework integration:

Core properties

Actions

The actions property provides methods to control drag operations:
See the DragDropManager API reference for details.

Registry

The registry manages all draggable and droppable entities:
Entities register themselves automatically when created with a manager.

Drag operation

The dragOperation property holds the current operation state:
All properties are reactive and trigger effects when accessed inside effect contexts.

Monitor

The monitor emits events during drag operations:
See the DragDropManager API reference for available event types.

Collision observer

The collisionObserver computes and manages collisions:
See Collision detection for details.

Customizable configuration

The Customizable<T> type allows flexible configuration:

As a value (replaces defaults)

As a function (receives defaults)

Filtering defaults

DOM implementation

The @dnd-kit/dom package extends the abstract manager with DOM-specific features:
The DOM layer automatically injects required plugins:
  • ScrollListener: Tracks scroll position changes
  • Scroller: Manages scroll offsets during drag
  • StyleInjector: Injects required CSS styles
These internal plugins are always included before your custom plugins, ensuring core functionality works correctly.

Default preset

The default configuration provides sensible defaults:
You can reference this preset to build custom configurations:

Lifecycle management

Cleanup

Always clean up the manager when you’re done:
The destroy() method:
  • Stops any active drag operation
  • Unregisters all entities
  • Cleans up all sensors
  • Destroys all plugins and modifiers
  • Removes event listeners

Framework integration

Framework adapters handle lifecycle automatically:

Type inference

The manager’s generic types flow through the entire system:

DragDropManager API

Complete API reference

Sensors

Input detection

Plugins

Extend functionality

Collision detection

Detect overlaps