A lightweight component that makes its children draggable.
$ npm install --save react-draggable-lite
import Draggable from 'react-draggable-lite';
...
<Draggable
onDragStart={() => console.log('drag start')}
onDragging={() => console.log('dragging')}
onDragEnd={() => console.log('drag end')}
>
<h1>Hello World</h1>
</Draggable>
Property | Description |
---|---|
onDragStart | A function that is called when the Draggable element is first clicked on or touched (on mousedown or touchstart ) |
onDragging | A function that is called when dragging the Draggable element (on mousemove or touchmove ) |
onDragEnd | A function that is called when the dragging has stopped (on mouseend or touchend ) |