An emoji showing crossed fingers svelte-promise-modals

SveltePromiseModals

Modals in Svelte made easy. Promised.🤞

Example for the modal

<script>
  import { openModal } from 'svelte-promise-modals';
  import FooComponent from './FooComponent.svelte';

  async function openFooModal() {
    let result = await openModal(FooComponent);
    console.log(result); // Whatever the modal returned when it was closed
  }
</script>

<button type="button" on:click={() => openFooModal()}>
  A simple modal with a button to close it
</button>

Example for custom animations

Code for the demonstrations shown here can be found in the demo application of the addon.

See the README on GitHub for setup & further instructions.

A red heart

svelte-promise-modals is
made & sponsored with ❤️ by

Mainmatter

yellow heart
smiley face surrounded by hearts