1.1.1 • Published 2 years ago

drag-react v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

React Draggable Component

A simple and lightweight component for making elements draggable.

Demo

stackblitz

Installation

$ npm install drag-react
# yarn add drag-react

Example

import { Draggable } from 'drag-react';

<Draggable>
  <div>My element is draggable now</div>
</Draggable>

Props

nametypedefaultdescription
childrenany-Some element
className?string'drag-react'Class name for drag wrapper
style?Object{ position: 'fixed', left: '10px', top: '10px', zIndex: 99999 , cursor: 'move' }css style for drag wrapper
onDragStart?(_: DOMRect) => void-Called whenever the user mouses down
onDragEnd?(_: DOMRect) => void-Called when dragging stops

License

MIT

1.1.1

2 years ago

1.1.0

2 years ago

0.0.7

2 years ago

0.0.9

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago

1.0.1

3 years ago

1.0.0

3 years ago