0.0.2 • Published 5 years ago

@artemis69/simple-svelte-modal v0.0.2

Weekly downloads
10
License
-
Repository
-
Last release
5 years ago

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>
0.0.2

5 years ago

0.0.1

5 years ago