Getting Started
Three steps to start opening dialogs
Install the package using your favored package manager:
npm install --save-dev svelte-component-dialogs
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 \>
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>