wobsoriano/svelte-sonner

Please add to documentation to use svelte-portal to use toaster

goldalworming opened this issue · 1 comments

It's better to use toaster inside port

the toast position will relative to body not to content. at first I have to scroll to top to see toaster now it's working
and it's position can on top of modal now. please add to documentation

I add the Toaster inside the main Layout:

<script>
	import '../app.scss';
	import { Toaster, toast } from 'svelte-sonner'
</script>

<div>
<Toaster richColors closeButton position="bottom-left" visibleToasts={5} />
</div>

<slot />

<style>
	div {
		position: absolute;
	}
</style>

and then import the toast in whatever components/pages I want to use the toasts:

import { toast } from 'svelte-sonner'
toast.success('Yay!')