# Toaster

> Toast notifications (Sonner) on the `popover` surface with a `border` and `radius-lg`; mount one `Toaster` at the root and call `toast()` from anywhere.

## Facts

- **Product**: Max
- **Family**: Feedback
- **Global**: `window.DigitalCrew.Toaster`
- **Source**: `max-agent: src/components/ui/sonner.tsx`
- **Import in the app**: `import { Toaster } from "@/components/ui/sonner";`
- **Live preview**: /design/components/toaster/preview.html
- **Page**: /design/components/toaster

## Guidelines

**Use it for** confirming what just happened and offering the next step: "Campaign launched", "3 drafted replies waiting for review — Review". Errors that need a decision go inline or in a dialog.

**What you provide**: `toast.success | error | warning | info | loading(title, { description, action })`. Titles report the outcome, not the effort ("Data found for 63 of 100 contacts", not "Enrichment complete"); errors say what failed and what happens next ("Couldn't save — Google rejected the change" / "We'll retry in a minute").

## API

```ts
declare const Toaster: ({ ...props }: ToasterProps) => JSX.Element;
export { Toaster };
```

## Example

```html
<div id="root" class="p-6"></div>
<script>
(function () {
  var h = React.createElement, DC = window.DigitalCrew, I = DC.Icons;
function App() {
  React.useEffect(function () {
    DC.toast.success("Campaign launched", { description: "214 prospects enter step 1 at 09:00." });
    setTimeout(function () { DC.toast("3 drafted replies waiting for review", { action: { label: "Review", onClick: function () {} } }); }, 150);
  }, []);
  return h("div", { className: "flex flex-wrap gap-2" },
    h(DC.Button, { variant: "outline", onClick: function () { DC.toast.error("Couldn't save — Google rejected the change", { description: "We'll retry in a minute." }); } }, "Error"),
    h(DC.Button, { variant: "outline", onClick: function () { DC.toast.warning("Out of AI credits", { description: "Add credits to keep drafting." }); } }, "Warning"),
    h(DC.Toaster, { position: "bottom-right" }));
}
  ReactDOM.createRoot(document.getElementById("root")).render(h(DC.TooltipProvider, { delayDuration: 80 }, h(App)));
})();
</script>
```

## More in Feedback

- [Alert](/design/components/alert.md): An inline, non-dismissable notice (`role="alert"`) with an optional icon, a one-line title and a description.
- [AnimatedCircularProgressBar](/design/components/animated-circular-progress-bar.md): A circular gauge for a value against a quota, with the number in the middle.
- [HelpTooltip](/design/components/help-tooltip.md): A 16px `HelpCircle` in `muted-foreground` that shows an explanation on hover or focus.
- [Progress](/design/components/progress.md): A determinate bar: `primary` fill on `primary` at 20%, 8px tall, `r-full`.
- [Skeleton](/design/components/skeleton.md): A placeholder block that pulses (`t-skel-pulse`, 1s) in `accent` while content loads.
