Draggable represents an entity that can be dragged in a drag and drop operation. It extends the base Entity class with draggable-specific functionality including sensor-based interaction handling, modifier-based behavior transformation, and status tracking.
Constructor
Creates a new draggable entity.DraggableInput<T>
required
Configuration object for the draggable.
U | undefined
required
The drag and drop manager instance, or undefined for unmanaged entities.
extends Data
default:"Data"
Type parameter for the data associated with this draggable.
extends DragDropManager<any, any>
default:"DragDropManager<any, any>"
Type parameter for the manager type.
Properties
Inherited from Entity
UniqueIdentifier
The unique identifier of the entity. Can be updated dynamically.
T
The data associated with the entity.
U | undefined
The drag and drop manager instance.
boolean
Whether the entity is disabled.
Draggable-Specific
Type | undefined
The type/category of the draggable entity.
Sensors | undefined
The sensors associated with this draggable entity.
Modifiers | undefined
The modifiers associated with this draggable entity.
Alignment | undefined
The alignment configuration for this draggable entity.
Plugins | undefined
Per-entity plugin configuration descriptors.
DraggableStatus
The current status of the draggable entity.
idle- Not being draggeddragging- Currently being draggeddropping- Currently being dropped
Computed Properties
isDragSource
boolean
Checks if this draggable is the source of the current drag operation.Returns
true if this entity’s ID matches the current drag operation’s source ID.isDragging
boolean
Checks if this draggable is currently being dragged.Returns
true if the status is 'dragging' and this is the drag source.isDropping
boolean
Checks if this draggable is currently being dropped.Returns
true if the status is 'dropping' and this is the drag source.Methods
pluginConfig()
Looks up per-entity options for a given plugin constructor.PluginConstructor
required
The plugin constructor to look up configuration for.
PluginOptions | undefined
The plugin options if configured for this entity, undefined otherwise.
Inherited from Entity
register()
Registers the entity with its manager.CleanupFunction | void
A cleanup function to unregister the entity, or void if no manager is set.
unregister()
Unregisters the entity from its manager.destroy()
Cleans up the entity when it’s no longer needed.Usage Examples
Basic Draggable
With Type
With Custom Sensors
With Modifiers
With Alignment
Checking Status
Dynamic Updates
TypeScript Types
Manual Registration
With Effects
Plugin Configuration
See Also
- DragDropManager - Managing drag operations
- Droppable - Creating drop targets
- Sensors - Handling user input
- Modifiers - Transforming drag behavior