1.0.24 • Published 7 years ago

drag-compoment v1.0.24

Weekly downloads
-
License
ISC
Repository
-
Last release
7 years ago

Dragme

Dragme is an drag component with react.js

Use this component to wrap the components you want to drag Or assign the component that you want to drag to the content props

preview:

npm run demo

install:

npm install drag-compoment --save

How to using:

import Dragme from 'drag-compoment'

<Dragme {...props}><YouCompoment /></Dragme>

or

<Dragme
  content={<YouComponent />}
  {...props}
/>

APIS

  1. onStart:
  • Call when move start\ @params {Object} e Event Object
  1. onEnd:
  • Call when move end\ @params {Object} e Event Object
  1. onMove:
  • Call when moving\ @params {Number} left content left value\ @params {Number} top content top value\ @params {Object} e Event Object

props

  1. top
  • Initial top value
  1. left
  • Initial left value
  1. width
  • Content width
  1. speed
  • Drag acceleration default 0

github: