svelte-inline-modal
TypeScript icon, indicating that this package has built-in type declarations

2.0.1 • Public • Published

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}>
  {#snippet button(open)}
    <button onclick={open}>Open</button>
  {/snippet}
  {#snippet menu(close)}
    <div>
      <!-- Your Modal Contents -->
      <button onclick={close}>Close</button>
    </div>
  {/snippet}
</InlineModal>

License

MIT

/svelte-inline-modal/

    Package Sidebar

    Install

    npm i svelte-inline-modal

    Weekly Downloads

    1,066

    Version

    2.0.1

    License

    MIT

    Unpacked Size

    6.58 kB

    Total Files

    7

    Last publish

    Collaborators

    • jill64