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

Entity Profile

Dependency Diagram

graph LR
  57344d7f_9f35_e634_85d7_d45b24e0b6d7["sonner.tsx"]
  75d25ec8_fe84_91a4_54c6_20dabb286f91["next-themes"]
  57344d7f_9f35_e634_85d7_d45b24e0b6d7 --> 75d25ec8_fe84_91a4_54c6_20dabb286f91
  e750d152_1191_1793_7244_99c7f9c595f4["sonner"]
  57344d7f_9f35_e634_85d7_d45b24e0b6d7 --> e750d152_1191_1793_7244_99c7f9c595f4
  de6fac54_74ca_6c25_8f8b_d1ba3287dbf2["icon-placeholder"]
  57344d7f_9f35_e634_85d7_d45b24e0b6d7 --> de6fac54_74ca_6c25_8f8b_d1ba3287dbf2
  style 57344d7f_9f35_e634_85d7_d45b24e0b6d7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"use client"

import { useTheme } from "next-themes"
import { Toaster as Sonner, type ToasterProps } from "sonner"

import { IconPlaceholder } from "@/app/(create)/components/icon-placeholder"

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

  return (
    <Sonner
      theme={theme as ToasterProps["theme"]}
      className="toaster group"
      icons={{
        success: (
          <IconPlaceholder
            lucide="CircleCheckIcon"
            tabler="IconCircleCheck"
            hugeicons="CheckmarkCircle02Icon"
            phosphor="CheckCircleIcon"
            remixicon="RiCheckboxCircleLine"
            className="size-4"
          />
        ),
        info: (
          <IconPlaceholder
            lucide="InfoIcon"
            tabler="IconInfoCircle"
            hugeicons="InformationCircleIcon"
            phosphor="InfoIcon"
            remixicon="RiInformationLine"
            className="size-4"
          />
        ),
        warning: (
          <IconPlaceholder
            lucide="TriangleAlertIcon"
            tabler="IconAlertTriangle"
            hugeicons="Alert02Icon"
            phosphor="WarningIcon"
            remixicon="RiErrorWarningLine"
            className="size-4"
          />
        ),
        error: (
          <IconPlaceholder
            lucide="OctagonXIcon"
            tabler="IconAlertOctagon"
            hugeicons="MultiplicationSignCircleIcon"
            phosphor="XCircleIcon"
            remixicon="RiCloseCircleLine"
            className="size-4"
          />
        ),
        loading: (
          <IconPlaceholder
            lucide="Loader2Icon"
            tabler="IconLoader"
            hugeicons="Loading03Icon"
            phosphor="SpinnerIcon"
            remixicon="RiLoaderLine"
            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

  • icon-placeholder
  • 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, UIPrimitives 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): icon-placeholder, next-themes, sonner.
Where is sonner.tsx in the architecture?
sonner.tsx is located at apps/v4/registry/bases/base/ui/sonner.tsx (domain: ComponentRegistry, subdomain: UIPrimitives, directory: apps/v4/registry/bases/base/ui).

Analyze Your Own Codebase

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

Try Supermodel Free