1.0.5 • Published 4 years ago
resize-chan v1.0.5
resize chan
A library to make HTML DOM elements resizable.
Install
yarn add resize-chan
Example
<div class="box">
<div class="box-resize-handle"></div>
</div>
import resizechan from 'resize-chan'
const box = document.querySelector('.box')
const boxResizeHandle = document.querySelector('.box-resize-handle')
resizechan(box, boxResizeHandle)
.box {
position: relative;
width: 100px;
height: 100px;
background: #ddd;
}
.box-resize-handle {
position: absolute;
bottom: 3px;
right: 3px;
width: 7px;
height: 7px;
border-right: 2px solid #666;
border-bottom: 2px solid #666;
cursor: nw-resize;
}