以前作ったreact-resizable-box
にドラッグで移動できる機能を付加したreact-resizable-and-movable
を作った。あまりいい名前が思いうかばず残念な感じになってしまった。
Demo
React-resizable-and-movable example
Repository
インストール
npm i react-resizable-and-movable
概要
付箋のようなものが必要だったので作った。start
プロパティでx
,y
,width
,height
を設定すれば使用できます。
<ResizableAndMovable start={{x:20, y:20, width:200, height:200}} <p>Example</p> </ResizableAndMovable>