Skip to content

ToastHost

function ToastHost(__namedParameters): Element;

Container that renders toast notifications for its children.

Place <ToastHost> near the root of your app. Children call useToast to push notifications.

ParameterType
__namedParametersToastHostProps

Element

function App() {
return (
<ToastHost position="bottom-right">
<MyApp />
</ToastHost>
);
}

PropertyTypeDescription
children?ReactNodeApplication content.
maxVisible?numberMaximum number of toasts visible simultaneously. Default 5.
position?ToastPositionWhere toasts appear. Default "bottom-right".

type ToastVariant = "info" | "success" | "warning" | "error";

Visual variant for a toast notification.


type ToastPosition = "top-right" | "top-left" | "bottom-right" | "bottom-left";

Screen corner where toasts are displayed.