JSFiddle - React, Tailwind, and code Playground
HTML
<div>
<p id="test">text</p>
</div>
CSS
div {
width: 100%;
background: #000;
}
p {
background: #ccc;
cursor: pointer;
display: inline-block;
padding: 5px;
}
JavaScript
$("#test").draggable({ axis: "x", revert: true });