0.0.23 • Published 2 years ago

@svelte-parts/modal v0.0.23

Weekly downloads
11
License
MIT
Repository
github
Last release
2 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

2 years ago

0.0.21

2 years ago

0.0.22

2 years ago

0.0.20

3 years ago

0.0.19

3 years ago

0.0.18

3 years ago

0.0.17

3 years ago

0.0.15

3 years ago

0.0.16

3 years ago

0.0.14

3 years ago

0.0.12

3 years ago

0.0.13

3 years ago

0.0.10

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago