Helper

Svelte

Optional Toaster plus svelte/toast for component icons and custom().

Live demo and install on this page. Step-by-step guide:Svelte docs.

Full docsPlayground
npm i alert-notify

Try it

Same core toast API this stack uses.

Mode: success · position top-right · richColors on

Install snippet

<script>
  import Toaster from "alert-notify/svelte";
  import { toast, custom } from "alert-notify/svelte/toast";
  import Icon from "./Icon.svelte";
</script>

<Toaster position="top-right" richColors />
<button onclick={() => toast.success("Saved")}>Save</button>
<button
  onclick={() =>
    toast.info("Pay with card", {
      icon: { component: Icon, props: { name: "card" } },
    })
  }
>
  With icon
</button>