Skip to main content

Custom icon

Allows to render a custom component as an icon.

Example

import CustomIcon from "@site/static/img/toast.svg";
import { toast, Toaster } from "@toastup/react";
import "@toastup/react/style";

export function CustomIconExample() {
const handleClick = () =>
toast.add({
icon: () => <CustomIcon className={styles.customIcon} />,
});
return (
<div>
<button onClick={handleClick}>Add toast</button>
<Toaster />
</div>
);
}