An open API service indexing awesome lists of open source software.

https://github.com/akashanand708/react-drag-element

react-drag-element provides a very simple way to make any react component draggable or floating on the screen.
https://github.com/akashanand708/react-drag-element

react react-dnd react-drag-and-drop react-draggable reactjs

Last synced: 3 months ago
JSON representation

react-drag-element provides a very simple way to make any react component draggable or floating on the screen.

Awesome Lists containing this project

README

        

# react-drag-element
react-drag-element provides a very simple way to make any react component draggable or floating on the screen. It also calculates top and left positions for draggable component.

# Installation
`npm install react-drag-element`

# Sample
![](ezgif.com-crop.gif)
# Quick Start

```
import CustomDrag from 'react-drag-element';

getFloatingComponentPosition = (positions) => {
console.log("FLOATING COMPONENT POSITIONS....", positions);
}

render{

return(


Header



);
}

```

# Props
1. getPositions --> Methods to get positions. (Optional)
2. dragItemId --> Id for the draggable component. (Required)
3. dragId --> Id for the div inside draggable component,user can drag and drop the draggable component by clicking and dragging this area. (Required)
4. draggingType --> horizontal/vertical (optional), if this value is not provided, it will behave random movement.