"use client";
import { ToastProvider } from "@pixxl-tools/components";| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | — | — |
closeLabel | string | — | Accessible label of every close button. Default: "Close notification: {title}" when the title is text, else "Close notification". |
container | Element | DocumentFragment | null | document.body | Portal container for the viewport (default document.body). |
duration | number | — | Default auto-dismiss delay in ms (default 5000; Infinity = sticky). Toasts with actions stay until dismissed unless they set duration. |
hotkey | string | null | F8 | Key that moves focus to the toasts, also from inside a modal dialog (default F8; null disables). Escape dismisses the focused toast. |
label | string | — | Landmark label of the toast region. |
max | number | 3 | Toasts shown at once; the rest wait in a queue (default 3). |
placement | ToastPlacement | — | Where it sits relative to its anchor (start/end follow the writing direction). |
store | ToastStore | — | Store to render (default: the global store used by toast()). |
childrenReactNode
closeLabelstring
Accessible label of every close button. Default: "Close notification: {title}" when the title is text, else "Close notification".
containerdefault document.bodyElement | DocumentFragment | null
Portal container for the viewport (default document.body).
durationnumber
Default auto-dismiss delay in ms (default 5000; Infinity = sticky). Toasts with actions stay until dismissed unless they set duration.
hotkeydefault F8string | null
Key that moves focus to the toasts, also from inside a modal dialog (default F8; null disables). Escape dismisses the focused toast.
labelstring
Landmark label of the toast region.
maxdefault 3number
Toasts shown at once; the rest wait in a queue (default 3).
placementToastPlacement
Where it sits relative to its anchor (start/end follow the writing direction).
storeToastStore
Store to render (default: the global store used by toast()).
// toast() works anywhere, even outside React.
function ExportButton() {
return <Button onClick={() => toast.success("Exported", { description: "PNG ready." })}>Export</Button>;
}
<ToastProvider>
<ExportButton />
</ToastProvider>