0.0.23 • Published 3 years ago

@svelte-parts/modal v0.0.23

Weekly downloads
11
License
MIT
Repository
github
Last release
3 years ago

@svelte-parts/modal

A simple modal for svelte

Demo

Try it out in the svelte REPL

Install

npm install @svelte-parts/modal

Usage

<script>
  import Modal from '@svelte-parts/modal'
  let open = false
</script>

<button on:click={() => open = true}>Demo</button>

<Modal open={open} onClose={() => open = false}>
  <div class="modal">
    <h1>Hello</h1>
    <p>from a modal</p>
    <p>Click outside of me to close</p>
  </div>
</Modal>

<style>
  .modal {
    background-color: white;
    padding: 2em;
    border-radius: 0.5em;
    min-width: 30vw;
  }
</style>
0.0.23

3 years ago

0.0.21

3 years ago

0.0.22

3 years ago

0.0.20

4 years ago

0.0.19

4 years ago

0.0.18

5 years ago

0.0.17

5 years ago

0.0.15

5 years ago

0.0.16

5 years ago

0.0.14

5 years ago

0.0.12

5 years ago

0.0.13

5 years ago

0.0.10

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago