Primitives
createDroppable
Create droppable targets with the createDroppable primitive.
Usage
The createDroppable primitive requires a unique id. It returns an object with an attach function and reactive state.
Input
Input properties are plain values that are read reactively. To keep an option in sync with reactive state, define it as a getter property on the input object (for example, createDroppable({id, get disabled() { return disabled; }})) so the primitive re-reads it when the underlying $state changes.
A unique identifier for this droppable instance.
The types of draggable elements this droppable accepts.
The type of this droppable element.
A custom collision detection algorithm.
Whether the droppable is disabled.
Custom data to attach to this droppable instance.
Output
Whether this element is currently a drop target (a draggable is hovering over it).
The underlying Droppable instance.
Attachment function for the droppable element. Use with {@attach}.