react-dragnow
v0.1.0
Published
A react-dnd wrapper.
Downloads
26
Readme
react-dragnow
A simple component for making elements draggable, base on react-dnd.
Installing
npm install react-dragnow
Usage
import React from 'react'
import ReactDOM from 'react-dom'
import DragNow from 'react-dragnow'
const App = () => (
<DragNow>
<div style={{ width: 300, height: 300, background: '#4a79dc' }} />
</DragNow>
)
ReactDOM.render(<App />, document.querySelector('body'))
Props
initialLeft
- Initial left value, default is 0.initialTop
- Initial top value, default is 0.autoCenter
- Default is true.