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

1.1.27 • 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} 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

Package Sidebar

Install

npm i svelte-inline-modal

Weekly Downloads

10,971

Version

1.1.27

License

MIT

Unpacked Size

7.18 kB

Total Files

7

Last publish

Collaborators

  • jill64