0.3.0 • Published 2 years ago

reactablejs v0.3.0

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

Reactablejs = Reactjs + Interactjs

A react high-order component for interactjs.

Current supported features:

  • drag
  • resize
  • drop
  • multi-touch
  • restrict
  • snap
  • modifiers

Current supported props:

  • options: draggable resizable gesturable dropzone.
  • event handlers: onDragStart onDragMove onDragInertiaStart onDragEnd onResizeStart onResizeMove onResizeInertiaStart onResizeEnd onGestureStart onGestureMove onGestureEnd onDropActivate onDropdEactivate onDragEnter onDragLeave onDropMove onDrop onDown onMove onUp onCancel onTap onDoubleTap onHold.

api details, visit interactjs' docs

Installation

reactablejs use interactjs as peerDependencies, you should also install interactjs.

npm install reactablejs interactjs --save

Usage

import React from 'react'
import reactable from 'reactablejs'

const MyComponent = (props) => {
  return <div ref={props.getRef}>
    hello, world!
  </div>
}

// MyComponent will receive getRef in props, put getRef to the element you want interact, then you can use all options and event handlers on Reactable

const Reactable = reactable(MyComponent) 

Example

0.3.0

2 years ago

0.2.0

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago