React Component for draggable and resizable elements.
Thanks to @mauricius for his work on vue-draggable-resizable component.
The current first version is a direct translation of react based on vue-draggable-resizable, which will be refactored later.
All properties and interfaces are consistent with vue-draggable-resizable
all Events: add "on" in front of its name.
eq: "activated" --> "onActivated"
$ npm install --save react-draggable-resizable-scalable
import { ReactDraggableResizable } from "/react-draggable-resizable";
import "/react-draggable-resizable/style.css"
const App = () => {
return (
<div className="content">
<div
style={{
height: "500px",
width: "500px",
border: " 1px solid red",
position: "relative",
}}
>
<ReactDraggableResizable
w={100}
h={100}
y={10}
x={30}
parent="true"
draggable
resizable
active
>
<p>
Hello! I'm a flexible component. You can drag me around and you can
resize me.
</p>
</ReactDraggableResizable>
</div>
</div>
);
};
export default App;
please email arvin.haoza@gmail.com
The MIT License (MIT). Please see License File for more information.