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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
__namedParameters | ToastHostProps |
Returns
Section titled “Returns”Element
Example
Section titled “Example”function App() { return ( <ToastHost position="bottom-right"> <MyApp /> </ToastHost> );}Properties
Section titled “Properties”| Property | Type | Description |
|---|---|---|
children? | ReactNode | Application content. |
maxVisible? | number | Maximum number of toasts visible simultaneously. Default 5. |
position? | ToastPosition | Where toasts appear. Default "bottom-right". |
ToastVariant
Section titled “ToastVariant”type ToastVariant = "info" | "success" | "warning" | "error";Visual variant for a toast notification.
ToastPosition
Section titled “ToastPosition”type ToastPosition = "top-right" | "top-left" | "bottom-right" | "bottom-left";Screen corner where toasts are displayed.