Draggable - @dnd-kit – Documentation
Home Examples Github Search ⌘ K Overview INTRODUCTION Installation Quick start API DOCUMENTATION DndContext Droppable Draggable useDraggable Drag Overlay Sensors Modifiers PRESETS Sortable GUIDES Accessibility Powered By GitBook Draggable Use the useDraggable hook turn DOM nodes into draggable sources that can be picked up, moved and dropped over droppable containers. Usage The useDraggable hook isn't particularly opinionated about how your app should be structured. Node ref At minimum though, you need to pass the setNodeRef function that is returned by the useDraggable hook to a DOM element so that it can access the underlying DOM node and keep track of it to detect collisions and intersections with other droppable elements. import {useDraggable} from '@dnd-kit/core'; import {CSS} from '@dnd-kit/utilities'; function Draggable() { const {attributes, listeners, setNodeRef, transform} = useDraggable({ id: 'unique-id', }); const style = { transform: CSS.Translate.toStr
Usage The useDraggable hook isn’t particularly opinionated about how your app should be structured. Node ref At minimum though, you need to pass the setNodeRef function that is returned by the useDraggable hook to a DOM element so that it can access the underlying DOM node and keep track of it to detect collisions and intersections with other droppable elements. import {useDraggable} from '@dnd-kit/core' ; import {CSS} from '@dnd-kit/utilities' ; function Draggable () { const {attributes, listeners, setNodeRef, transform} = useDraggable ({ id: 'unique-id' , }); const style = { transform: CSS.T
Explore this link on the map →related reading
- Getting Started - Legacy | dnd kitdocs.dndkit.com
- Drag Overlay - Legacy | dnd kitdocs.dndkit.com
- Sortable - Legacy | dnd kitdocs.dndkit.com
- HTML Drag and Drop API - Web APIs | MDNdeveloper.mozilla.org
- Redirecting to: /legacy/api-documentation/context-provider/dnd-contextdocs.dndkit.com
- Installation - Legacy | dnd kitdocs.dndkit.com
- Chloe's Gardenchloeyan.me
- Raindrop.ioapp.raindrop.io
- HTMLElement: drop event - Web APIs | MDNdeveloper.mozilla.org
- Sorrel Salb | Are.naare.na
- WePresent | Join FKA twigs on her healing journey in Atlantawepresent.wetransfer.com
- shen ✸ | Are.naare.na