Helper

React

Optional Toaster, React-aware toast with JSX icons, and custom().

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

Full docsPlayground
npm i alert-notify

The React entry is a Client Component, so Next.js App Router can import Toaster from a Server Component parent.

Try it

Same core toast API this stack uses.

Mode: success · position top-right · richColors on

Install snippet

import { toast, Toaster, custom } from "alert-notify/react";

export function App() {
  return (
    <>
      <Toaster position="top-right" richColors />
      <button onClick={() => toast.success("Saved")}>Save</button>
      <button
        onClick={() =>
          toast.info("Pay with card", {
            icon: <img src="/card.png" alt="" />,
          })
        }
      >
        With icon
      </button>
      <button onClick={() => custom(<div>Custom React content</div>)}>
        Custom
      </button>
    </>
  );
}