svelte-notifications icon indicating copy to clipboard operation
svelte-notifications copied to clipboard

How to use with Sveltekit?

Open geoidesic opened this issue 1 year ago • 1 comments

The example shows

import App from './App.svelte';
...
<Notifications>
  <App />
</Notifications>

But that's not compatible with Sveltekit, I don't think?

geoidesic avatar Sep 01 '23 18:09 geoidesic

For use in SvelteKit, it must be placed in the first layout as shown below:

├───src
│   └── routes
│       ├── +layout.svelte
│       └── +page.svelte
/* +layout.svelte */
<script lang="ts">
	import Notifications from 'svelte-notifications';
</script>

<Notifications>
	<slot />
</Notifications>

louchebem06 avatar Feb 06 '24 17:02 louchebem06