Skip to main content
Version: 2.0 (Latest)

jsx-content

🧩 JSX Content Examples​

toast.success(
<div>
<strong>Payment received</strong>
<p>Your invoice was paid successfully.</p>
</div>
);

🔔 Confirm toast​

  const handleConfirm = () => {
let toastIdRef = null;

const model = (
<div className="confirm_box">
<h1>Delete</h1>
<p>Are you sure, do you want delete?</p>
<div className="confirm_actions">
<button onClick={() => toastIdRef && toast.dismiss(toastIdRef)}>
Cancel
</button>
<button
onClick={() => {
// Delete logic
toastIdRef && toast.dismiss(toastIdRef);
}}
>
Delete
</button>
</div>
</div>
);

const id = toast(model, {
position: "center",
autoClose: false,
title: false,
expand: true,
});

toastIdRef = id;
};