Getting Started

Three steps to start opening dialogs

  1. Install the package using your favored package manager:

    npm install --save-dev svelte-component-dialogs

  2. Add the DialogProvider component somewhere in your app (for SvelteKit the base +layout.svelte file is a good place):

    <script>
        import { DialogProvider } from 'svelte-component-dialogs';
    </script>
    
    <slot \>
    <DialogProvider \>
  3. Start using dialogs:

    <script>
        import PreMadeComponent from './PreMadeComponent.svelte';
        import { openDialog } from 'svelte-component-dialogs';
    
        const open = () => {
            openDialog(PreMadeComponent);
        };
    </script>
    
    <button on:click={open}>Open Dialog</button>