@sushantdsuwal/react-native-drag
v0.1.3
Published
draggable
Downloads
14
Maintainers
Readme
react-native-drag
draggable, drag n drop, reanimated-draggable
Installation
npm install @sushantdsuwal/react-native-drag
Usage
import Drag from "@sushantdsuwal/react-native-drag";
// ...
<Drag
height={height} // element height
width={width} // element width
x={x} // x position for element
y={y} // y position for element
maxHeight={maxHeight} //layout max height
maxWidth={maxWidth} //layout max width
onDragEnd={(boxPosition) => {
const newBoxPosition = {
...boxPosition,
x: boxPosition.x,
y: boxPosition.y,
height: boxPosition.height,
width: boxPosition.width,
}
}} // new position of element after drag
>
<View><Text>Box 1</Text></View>
</Drag>
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT