JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/interact.js/1.2.6/interact.min.js"></script>
<div class="container">
<div class="resizable">
Use right/bottom edge to resize
</div>
</div>
CSS
.resizable {
color: white;
font-size: 14px;
padding: 10px;
margin: 10px;
width: 150px;
box-sizing: border-box;
background-color: #0073aa;
}
JavaScript
interact('.resizable')
.resizable({
edges: { right: true, bottom: true }
})
.on('resizemove', function (event) {
var target = event.target;
// update the element's style
target.style.width = event.rect.width + 'px';
target.style.height = event.rect.height + 'px';
});