0.0.7 • Published 8 years ago

@joegesualdo/react-draggable v0.0.7

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

react-draggable Build Status

A React component to make elements draggable.

Install

$ npm install --save @joegesualdo/react-draggable

react-draggable-demo

Usage

import Draggable from '@joegesualdo/react-draggable';
import React from 'react';
import ReactDOM from 'react-dom';

ReactDOM.render(
  <div style={{width: 1000, height: 1000}}>
    <Draggable
      axis='both'
      defaultPosition={{x: 0, y:0}}
      onDrag={function(e){console.log(e)}}
      onStart={function(){console.log('started')}}
      onStop={function(){console.log('stopped')}}
    >
      // The element you want to make draggable
      <div style={{backgroundColor: 'blue', width: 100, height: 60}}>
        Woo!
      </div>
    </Draggable>
  </div>,
  document.querySelector('#app')
)

Test

$ npm test

Build

$ npm run build

License

MIT © Joe Gesualdo

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago