useDragDrop API
API reference for the useDragDrop composable.
Related
Explore these related pages for additional context and usage patterns.
| Page | Category |
|---|---|
| useDragDrop | System |
| createRegistry | Registration |
| createContext | Foundation |
| useRovingFocus | System |
Functions
useDragDrop
(options?: DragDropOptions<Z>) => DragDropContext<Z>Create a headless drag-and-drop context.
Options
adapters
DragDropAdapter<Z>[] | undefinedplugins
DragDropPlugin<Z>[] | undefinedonBeforeStart
((drag: ActiveDrag<Z>) => boolean | void) | undefinedonMove
((drag: ActiveDrag<Z>) => void) | undefinedonBeforeDrop
((drag: ActiveDrag<Z>, position: DropPosition) => boolean | void) | undefinedonDrop
((drag: ActiveDrag<Z>, position: DropPosition) => void) | undefinedonCancel
((drag: ActiveDrag<Z>, reason: "cancel" | "reject") => void) | undefinedProperties
draggables
DraggablesContext<Z>zones
ZonesContext<Z>active
Readonly<ShallowRef<ActiveDrag<Z> | null>>isDragging
Readonly<Ref<boolean, boolean>>Methods
cancel
() => void