simpledragger
v0.4.0
Published
[![](https://img.shields.io/npm/v/simpledragger)](https://www.npmjs.com/package/simpledragger) [![](https://badgen.net/packagephobia/install/simpledragger)](https://packagephobia.com/result?p=simpledragger)
Downloads
23
Readme
simpledragger
add script tag to load the web-component
<script type="module" src="https://unpkg.com/simpledragger" />
use the window component
<simple-dragger-window onclose="event.target.remove()">
<strong slot="title">draggable</strong>
<p>not draggable</p>
</simple-dragger-window>
use the low-level component
<simple-dragger>
<strong data-draggable>draggable</strong>
<hr />
<p>not draggable</p>
</simple-dragger>
or use the low-level api
<div class="test">
<header data-draggable>
<strong>draggable</strong>
</header>
<hr />
<p>not draggable</p>
</div>
<script type="module">
import { makeDraggable } from "https://unpkg.com/simpledragger";
// make an element draggable
makeDraggable(document.querySelector(".test"), document.querySelector(".test > [data-draggable]"));
</script>