Usage
TheuseDraggable hook requires a unique id and returns a ref callback and reactive getters for drag state.
Input
A unique identifier for this draggable instance. Use getter syntax (
get id() { return props.id }) for reactive values.A handle element. When set, only this element activates dragging. Use the
handleRef callback to set it.Whether the draggable is disabled.
An array of plugin descriptors for per-entity plugin configuration. Use
Plugin.configure() to create descriptors. For example, Feedback.configure({ feedback: 'clone' }).Modifiers to apply to this draggable instance.
Sensors to use for this draggable instance.
Custom data to attach to this draggable instance.
Output
A callback ref to attach to the draggable element.
A callback ref to attach to a drag handle element.
Whether this element is currently being dragged. Call as
isDragging() in JSX.Whether this element is in the process of being dropped. Call as
isDropping() in JSX.Whether this element is the source of the current drag operation. Call as
isDragSource() in JSX.The underlying
Draggable instance.Guides
Rendering a drag overlay
You can render a completely different element while the draggable element is being dragged by using the<DragOverlay> component.

<DragOverlay> component will only render its children when a drag operation is in progress. This can be useful for rendering a completely different element while the draggable element is being dragged.
To render different content depending on which element is being dragged, pass a function as a child that receives the drag source: