Skip to content

Latest commit

 

History

History
29 lines (21 loc) · 458 Bytes

README.md

File metadata and controls

29 lines (21 loc) · 458 Bytes

svelte-modal-renderer

Just a barebone demo to render something from anywhere

Usage

App.svelte

<ModalsRenderer>
   ...Your app
</ModalsRenderer>

Modal1.svelte

<script lang="ts">
  const { requestClose } = $$restProps;
</script>

<button on:click={requestClose}>Close</button>

Somewhere.svelte

const { openModal } = useModal();

const { closeModal } = openModal(Modal1, { ...props }, { ...config });