react-dragnow

0.1.0 • Public • Published

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'))

snapshot

Edit nz1v07z7p

Props

  • initialLeft - Initial left value, default is 0.
  • initialTop - Initial top value, default is 0.
  • autoCenter - Default is true.

Package Sidebar

Install

npm i react-dragnow

Weekly Downloads

1

Version

0.1.0

License

Apache-2.0

Unpacked Size

37.6 kB

Total Files

23

Last publish

Collaborators

  • yinfxs