@artemis69/simple-svelte-modal

Svelte Modal

Usage no npm install needed!

<script type="module">
  import artemis69SimpleSvelteModal from 'https://cdn.skypack.dev/@artemis69/simple-svelte-modal';
</script>

README

Svelte Modal

this but edited by me for me

Dont use it, please

Usage

<script>
    import Modal from '@artemis69/simple-svelte-modal';
    import { getContext } from 'svelte';
    const { open } = getContext('modal');

    //Import your svelte component here
    import ModalContent from '';

    const clickHandler = () => {
        //ModalContent is component you want to be displayed inside modal
        //It better to be some <p></p> and <a href="#"></a> elements
        open(ModalContent, { 
            //Props that exported from component, like 'export let name'
            name: 'Artem'
        })
    }
</script>

<Modal>
    <button on:click={clickHandler}>
        Open modal
    </button>
</Modal>