1.0.0 • Published 7 years ago

react-draggable-lite v1.0.0

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

React-Draggable (lite)

Travis Codecov npm semantic-release

A lightweight component that makes its children draggable.

Installation

$ npm install --save react-draggable-lite

Basic Usage

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>

API

PropertyDescription
onDragStartA function that is called when the Draggable element is first clicked on or touched (on mousedown or touchstart)
onDraggingA function that is called when dragging the Draggable element (on mousemove or touchmove)
onDragEndA function that is called when the dragging has stopped (on mouseend or touchend)