Home / Function/ Toaster() — ui Function Reference

Toaster() — ui Function Reference

Architecture documentation for the Toaster() function in sonner.tsx from the ui codebase.

Entity Profile

Dependency Diagram

graph TD
  610f4108_8661_f625_d18a_636fcb0412a1["Toaster()"]
  47393a1f_d244_f281_d461_a18f9c97f037["sonner.tsx"]
  610f4108_8661_f625_d18a_636fcb0412a1 -->|defined in| 47393a1f_d244_f281_d461_a18f9c97f037
  style 610f4108_8661_f625_d18a_636fcb0412a1 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/v4/examples/radix/ui-rtl/sonner.tsx lines 13–43

const Toaster = ({ ...props }: ToasterProps) => {
  const { theme = "system" } = useTheme()

  return (
    <Sonner
      theme={theme as ToasterProps["theme"]}
      className="toaster group"
      icons={{
        success: <CircleCheckIcon className="size-4" />,
        info: <InfoIcon className="size-4" />,
        warning: <TriangleAlertIcon className="size-4" />,
        error: <OctagonXIcon className="size-4" />,
        loading: <Loader2Icon className="size-4 animate-spin" />,
      }}
      style={
        {
          "--normal-bg": "var(--popover)",
          "--normal-text": "var(--popover-foreground)",
          "--normal-border": "var(--border)",
          "--border-radius": "var(--radius)",
        } as React.CSSProperties
      }
      toastOptions={{
        classNames: {
          toast: "cn-toast",
        },
      }}
      {...props}
    />
  )
}

Subdomains

Frequently Asked Questions

What does Toaster() do?
Toaster() is a function in the ui codebase, defined in apps/v4/examples/radix/ui-rtl/sonner.tsx.
Where is Toaster() defined?
Toaster() is defined in apps/v4/examples/radix/ui-rtl/sonner.tsx at line 13.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free