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 DocumentationAtlas SearchAPI 3 imports 1 functions

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

"use client"

import {
  CircleCheckIcon,
  InfoIcon,
  Loader2Icon,
  OctagonXIcon,
  TriangleAlertIcon,
} from "lucide-react"
import { useTheme } from "next-themes"
import { Toaster as Sonner, type ToasterProps } from "sonner"

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}
    />
  )
}

export { Toaster }

Subdomains

Functions

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 DocumentationAtlas domain, SearchAPI 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 apps/v4/examples/radix/ui-rtl/sonner.tsx (domain: DocumentationAtlas, subdomain: SearchAPI, directory: apps/v4/examples/radix/ui-rtl).

Analyze Your Own Codebase

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

Try Supermodel Free