yarn add svelte-fire-toast
npm install svelte-fire-toast
Add the Toaster to your app first (entry point +layout.svelte). It will take care of rendering all notifications emitted. Now you can trigger toast()
or use:fireAction
from anywhere!
<script>
import { Toaster, toastAction } from 'svelte-fire-toast';
</script>
<Toaster />
<button use:toastAction={'Toasted!'}> Fire </button>
Find the full API reference on official documentation.