Quick start with svelte-sonner
mainTo use svelte-sonner, first add the <Toaster /> component to your application root. This component serves as the container where all toasts will be rendered. Once added, you can trigger toasts from anywhere in your app using the toast() function.
<script>
import { Toaster, toast } from 'svelte-sonner';
</script>
<Toaster />
<button onclick={() => toast('My first toast')}>Give me a toast</button><script>
import { Toaster, toast } from 'svelte-sonner';
</script>
<Toaster />
<button onclick={() => toast('My first toast')}>Give me a toast</button>