1.0.3 • Published 4 years ago

svelte-draggable-draw v1.0.3

Weekly downloads
58
License
-
Repository
-
Last release
4 years ago

Svelte draggable draw/modal

A svelte draggable draw/modal just like what you had seen in any of the mobile app!

Demo

example

Svelte.dev Repl

TODO:

  • Allow adjustment for width
  • Allow adjustment for custom unit instead of viewport only
  • Allow adjustment for custom box shadow
  • Allow adjustment for custom padding

Setting up

npm install svelte-draggable-draw

Consuming components

<script>
    import DraggableDraw from 'svelte-draggable-draw';
    let visible = true;
    let maxVH = 90;
    let minVH = 85;

    function switchVisible(){
        visible = !visible;
    }
</script>

<button on:click={switchVisible}>Click me to open</button>
<DraggableDraw bind:visible {maxVH} {minVH}>
    <span slot="left" on:click={switchVisible}>Cancel</span>
    <span slot="right" on:click={switchVisible}>Submit</span>

    <div>
        <h1>Content</h1>
        <p>Can be injected here</p>
    </div>
</DraggableDraw>

Enjoy😎!

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago