Skip to main content
Draggables and droppables are the fundamental entities in dnd-kit. They represent elements that can be dragged and elements that can receive dragged items.

Entity base class

Both Draggable and Droppable extend a common Entity base class:

Unique identifier

Every entity has a unique identifier that can be a string or number:
The id is used to:
  • Register/unregister entities in the manager’s registry
  • Identify entities during drag operations
  • Look up entities by ID
  • Track entity relationships
Identifiers must be unique within their entity type. Having two draggables with the same ID will cause unexpected behavior.

Data property

The data property stores custom data associated with the entity:
You can access this data during drag operations:

Disabled state

You can disable entities to prevent interaction:
Disabled entities:
  • Won’t respond to sensor input (draggables)
  • Won’t participate in collision detection (droppables)
  • Remain in the registry but are skipped during operations

Draggable

A Draggable represents an element that can be dragged.

Creating a draggable

Type signature

Element and handle

The element is the DOM element that represents the draggable:
Optionally specify a handle to restrict where dragging can start:
When a handle is specified:
  • Dragging only starts when interacting with the handle
  • The rest of the element remains interactive
  • Useful for complex UI elements with buttons, links, etc.

Status tracking

Draggables track their current status:
Status transitions:

Type categorization

The type property categorizes draggables:
Droppables can accept only specific types:

Per-entity configuration

You can override manager settings for individual draggables:

Droppable

A Droppable represents an element that can receive dragged items.

Creating a droppable

Type signature

Collision detection

Every droppable requires a collision detector:
See Collision detection for available detectors.

Acceptance rules

Control which draggables can be dropped: Accept a specific type:
Accept multiple types:
Custom acceptance function:
Accept all (default):

Collision priority

When multiple droppables collide, priority determines the winner:
You can also use custom numeric priorities:

Shape tracking

Droppables track their bounding rectangle:
The shape is automatically updated during drag operations.

Drop target status

Check if a droppable is the current drop target:

Registration

Entities automatically register with the manager when created:

Manual registration

You can disable automatic registration:

Registration lifecycle

Entities can register effects that run when registered:

Reactive properties

Many entity properties are reactive:
Reactive properties:
  • disabled
  • data
  • type
  • status (draggables)
  • accept (droppables)
  • shape (droppables)
  • modifiers (draggables)

Type safety

You can type the data property:

Framework integration

Framework adapters provide idiomatic APIs:

Draggable API

Draggable API reference

Droppable API

Droppable API reference

Collision detection

How collisions work

Data flow

Working with entity data