0.3.0 • Published 4 years ago
reactablejs v0.3.0
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:
draggableresizablegesturabledropzone. - event handlers:
onDragStartonDragMoveonDragInertiaStartonDragEndonResizeStartonResizeMoveonResizeInertiaStartonResizeEndonGestureStartonGestureMoveonGestureEndonDropActivateonDropdEactivateonDragEnteronDragLeaveonDropMoveonDroponDownonMoveonUponCancelonTaponDoubleTaponHold.
api details, visit interactjs' docs
Installation
reactablejsuseinteractjsaspeerDependencies, 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
- visit storybooks