1.1.16 • Published 6 years ago

react-dragndrop v1.1.16

Weekly downloads
3
License
ISC
Repository
github
Last release
6 years ago

react-dragndrop (ES2015)

Simplistic library with minimal boilerplate code to get started. This library comes with 2 React components: <Draggable> and <DropTarget>. In order for these two components to talk to each other, an instance of DragDropManager must be created with the following code:

import {DragDropManager, Draggable, DropTarget} from 'react-dragndrop'
let manager = new DragDropManager()

render(){
    return (
      <div>
        <Draggable manager={manager}>Drag me!</Draggable>
        <DropTarget manager={manager}>Here!</DropTarget>
      </div>
      )
}

Draggable

Whatever it is you want dragged, nest it inside of the Draggable component. This wrapper allows for customization for every stage of the Draggable life cycle. Base style, clicked style, dragging style. Once the Draggable is actually dropped in the DropTarget, it is up to the user to style the component at that point.

Example:

  <Draggable manager={manager}>I want this dragged!</Draggable>

PropTypes:

manager: React.PropTypes.instanceOf(DragDropManager).isRequired,

id: React.PropTypes.string,

draggingStyle: React.PropTypes.object,

clickedStyle: React.PropTypes.object,

style: React.PropTypes.object,

baseClassName: React.PropTypes.string,

clickedClassName: React.PropTypes.string,

draggingClassName: React.PropTypes.string,

droppedClassName: React.PropTypes.string,

handleMouseUp: React.PropTypes.func,

handleMouseDown: React.PropTypes.func,

handleDrop: React.PropTypes.func

DropTarget

This component allows multiple different types of children. It allows object, JSX, or a simple string to be nested within.

This component is how you listen to events.

Example:

  <DropTarget manager={manager}>This text will be appended to with the Draggable text</DropTarget>

PropTypes:

manager: React.PropTypes.instanceOf(DragDropManager).isRequired,

style: React.PropTypes.object,

wrapper: React.PropTypes.any,

handleDraggableHoveringOverDropTarget: React.PropTypes.func,

handleDroppedDraggable: React.PropTypes.func

1.1.16

6 years ago

1.1.15

6 years ago

1.1.14

6 years ago

1.1.13

6 years ago

1.1.12

6 years ago

1.1.11

6 years ago

1.1.10

6 years ago

1.1.9

6 years ago

1.1.8

6 years ago

1.1.7

6 years ago

1.1.6

6 years ago

1.1.5

6 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.55

7 years ago

1.0.54

7 years ago

1.0.53

8 years ago

1.0.52

8 years ago

1.0.51

8 years ago

1.0.50

8 years ago

1.0.49

8 years ago

1.0.48

8 years ago

1.0.47

8 years ago

1.0.46

8 years ago

1.0.45

8 years ago

1.0.44

8 years ago

1.0.43

8 years ago

1.0.42

8 years ago

1.0.41

8 years ago

1.0.40

8 years ago

1.0.39

8 years ago

1.0.38

8 years ago

1.0.37

8 years ago

1.0.36

8 years ago

1.0.35

8 years ago

1.0.34

8 years ago

1.0.33

8 years ago

1.0.32

8 years ago

1.0.31

8 years ago

1.0.30

8 years ago

1.0.29

8 years ago

1.0.28

8 years ago

1.0.27

8 years ago

1.0.26

8 years ago

1.0.25

8 years ago

1.0.24

8 years ago

1.0.23

8 years ago

1.0.22

8 years ago

1.0.21

8 years ago

1.0.20

8 years ago

1.0.19

8 years ago

1.0.18

8 years ago

1.0.17

8 years ago

1.0.16

8 years ago

1.0.15

8 years ago

1.0.14

8 years ago

1.0.13

8 years ago

1.0.12

8 years ago

1.0.11

8 years ago

1.0.10

8 years ago

1.0.9

8 years ago

1.0.8

8 years ago

1.0.7

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago