Home / File/ sonner.tsx — ui Source File

sonner.tsx — ui Source File

Architecture documentation for sonner.tsx, a tsx file in the ui codebase. 3 imports, 0 dependents.

File tsx ComponentRegistry ChartRegistry 3 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  10bafd2b_6d22_66cb_b571_5e36a553c6c1["sonner.tsx"]
  d39cd1e4_1b2d_9aa2_1d29_fd0b4bfb61c3["lucide-react"]
  10bafd2b_6d22_66cb_b571_5e36a553c6c1 --> d39cd1e4_1b2d_9aa2_1d29_fd0b4bfb61c3
  75d25ec8_fe84_91a4_54c6_20dabb286f91["next-themes"]
  10bafd2b_6d22_66cb_b571_5e36a553c6c1 --> 75d25ec8_fe84_91a4_54c6_20dabb286f91
  e750d152_1191_1793_7244_99c7f9c595f4["sonner"]
  10bafd2b_6d22_66cb_b571_5e36a553c6c1 --> e750d152_1191_1793_7244_99c7f9c595f4
  style 10bafd2b_6d22_66cb_b571_5e36a553c6c1 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"use client"

import {
  CircleCheck,
  Info,
  LoaderCircle,
  OctagonX,
  TriangleAlert,
} from "lucide-react"
import { useTheme } from "next-themes"
import { Toaster as Sonner } from "sonner"

type ToasterProps = React.ComponentProps<typeof Sonner>

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

  return (
    <Sonner
      theme={theme as ToasterProps["theme"]}
      className="toaster group"
      icons={{
        success: <CircleCheck className="h-4 w-4" />,
        info: <Info className="h-4 w-4" />,
        warning: <TriangleAlert className="h-4 w-4" />,
        error: <OctagonX className="h-4 w-4" />,
        loading: <LoaderCircle className="h-4 w-4 animate-spin" />,
      }}
      toastOptions={{
        classNames: {
          toast:
            "group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",
          description: "group-[.toast]:text-muted-foreground",
          actionButton:
            "group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",
          cancelButton:
            "group-[.toast]:bg-muted group-[.toast]:text-muted-foreground",
        },
      }}
      {...props}
    />
  )
}

export { Toaster }

Subdomains

Functions

Types

Dependencies

  • lucide-react
  • next-themes
  • sonner

Frequently Asked Questions

What does sonner.tsx do?
sonner.tsx is a source file in the ui codebase, written in tsx. It belongs to the ComponentRegistry domain, ChartRegistry subdomain.
What functions are defined in sonner.tsx?
sonner.tsx defines 1 function(s): Toaster.
What does sonner.tsx depend on?
sonner.tsx imports 3 module(s): lucide-react, next-themes, sonner.
Where is sonner.tsx in the architecture?
sonner.tsx is located at deprecated/www/registry/default/ui/sonner.tsx (domain: ComponentRegistry, subdomain: ChartRegistry, directory: deprecated/www/registry/default/ui).

Analyze Your Own Codebase

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

Try Supermodel Free