jill64 / svelte-inline-modal

🪟 Simple Modal on the Fly

Home Page:https://svelte-inline-modal.jill64.dev

Repository from Github https://github.comjill64/svelte-inline-modalRepository from Github https://github.comjill64/svelte-inline-modal

svelte-inline-modal

npm-version npm-license npm-download-month npm-min-size ci.yml website

🪟 Simple Modal on the Fly

StackBlitz

Installation

npm i svelte-inline-modal

Usage

Unlike most modal libraries that provide a common component at the root, this library deploys the modal in place using the dialog element.

<script>
  import { InlineModal } from 'svelte-inline-modal'

  const onCloseModal = () => {
    // ...
  }
</script>

<InlineModal onClose={onCloseModal} let:open>
  <button on:click={open}>Open</button>
  <div slot="menu" let:close>
    <!-- Your Modal Contents -->
    <button on:click={close}>Close</button>
  </div>
</InlineModal>

License

MIT

About

🪟 Simple Modal on the Fly

https://svelte-inline-modal.jill64.dev

License:MIT License


Languages

Language:Svelte 46.9%Language:TypeScript 43.0%Language:JavaScript 6.6%Language:HTML 3.5%