This library aims to provide a flexible, Nebular-like API for opening HTML5 dialogs with pre-made svelte components as the content.
npm install svelte-component-dialogs
DialogProvider
somewhere in your app (for SvelteKit you can use your root +layout.svelte
file)<script>
import { DialogProvider } from 'svelte-component-dialogs';
</script>
<slot />
<DialogProvider />
openDialog
utility<script>
import PreMadeComponent from './PreMadeComponent.svelte';
import { openDialog } from 'svelte-component-dialogs';
const open = () => openDialog(PreMadeComponent);
</script>
<button on:click="{open}">Open Dialog</button>
This is my first open source project, so contributions are welcomed.
You can start the project locally in the following way:
pnpm install
to install dependencies (or npm, yarn)pnpm dev
to start the dev serverpnpm format
to format the project with eslint and prettierpnpm build:package
to build the librarypnpm build:docs
to build the documentation siteSome things that still need to be done:
MIT