Skip to main content

Limit visible toasts

Allows to set a maximum number of toasts that can be displayed on the screen simultaneously.

Example

import { toast, Toaster } from "@toastup/react";
import "@toastup/react/style";

export function LimitVisibleToastsExample() {
const handleClick = () => toast.add({ autoHide: 15000 });
return (
<div>
<button onClick={handleClick}>Add toast</button>
<Toaster visibleToasts={3} />
</div>
);
}
info

visibleToasts option is available only for the Toaster component.