Home / File/ toast.tsx — ui Source File

toast.tsx — ui Source File

Architecture documentation for toast.tsx, a tsx file in the ui codebase. 5 imports, 0 dependents.

File tsx ComponentRegistry ChartRegistry 5 imports 6 functions

Entity Profile

Dependency Diagram

graph LR
  84d197dd_9e9e_d766_2118_ef01fbda513e["toast.tsx"]
  1d141819_425e_b5fd_4c8e_32f7c6a42cf2["react"]
  84d197dd_9e9e_d766_2118_ef01fbda513e --> 1d141819_425e_b5fd_4c8e_32f7c6a42cf2
  6ac76527_1557_f367_82fb_3aa307be52b8["react-toast"]
  84d197dd_9e9e_d766_2118_ef01fbda513e --> 6ac76527_1557_f367_82fb_3aa307be52b8
  25383e8d_ca91_a50e_c3a8_5f228d02e1df["class-variance-authority"]
  84d197dd_9e9e_d766_2118_ef01fbda513e --> 25383e8d_ca91_a50e_c3a8_5f228d02e1df
  d39cd1e4_1b2d_9aa2_1d29_fd0b4bfb61c3["lucide-react"]
  84d197dd_9e9e_d766_2118_ef01fbda513e --> d39cd1e4_1b2d_9aa2_1d29_fd0b4bfb61c3
  79081a1f_55a3_945a_fb8c_d53d6d3eab81["utils"]
  84d197dd_9e9e_d766_2118_ef01fbda513e --> 79081a1f_55a3_945a_fb8c_d53d6d3eab81
  style 84d197dd_9e9e_d766_2118_ef01fbda513e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"use client"

import * as React from "react"
import * as ToastPrimitives from "@radix-ui/react-toast"
import { cva, type VariantProps } from "class-variance-authority"
import { X } from "lucide-react"

import { cn } from "@/lib/utils"

const ToastProvider = ToastPrimitives.Provider

const ToastViewport = React.forwardRef<
  React.ElementRef<typeof ToastPrimitives.Viewport>,
  React.ComponentPropsWithoutRef<typeof ToastPrimitives.Viewport>
>(({ className, ...props }, ref) => (
  <ToastPrimitives.Viewport
    ref={ref}
    className={cn(
      "fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",
      className
    )}
    {...props}
  />
))
ToastViewport.displayName = ToastPrimitives.Viewport.displayName

const toastVariants = cva(
  "group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",
  {
    variants: {
      variant: {
        default: "border bg-background text-foreground",
        destructive:
          "destructive group border-destructive bg-destructive text-destructive-foreground",
      },
    },
    defaultVariants: {
      variant: "default",
    },
  }
)

const Toast = React.forwardRef<
  React.ElementRef<typeof ToastPrimitives.Root>,
  React.ComponentPropsWithoutRef<typeof ToastPrimitives.Root> &
    VariantProps<typeof toastVariants>
>(({ className, variant, ...props }, ref) => {
  return (
    <ToastPrimitives.Root
      ref={ref}
      className={cn(toastVariants({ variant }), className)}
      {...props}
    />
  )
})
Toast.displayName = ToastPrimitives.Root.displayName

const ToastAction = React.forwardRef<
  React.ElementRef<typeof ToastPrimitives.Action>,
  React.ComponentPropsWithoutRef<typeof ToastPrimitives.Action>
// ... (70 more lines)

Subdomains

Dependencies

  • class-variance-authority
  • lucide-react
  • react
  • react-toast
  • utils

Frequently Asked Questions

What does toast.tsx do?
toast.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 toast.tsx?
toast.tsx defines 6 function(s): Toast, ToastAction, ToastClose, ToastDescription, ToastTitle, ToastViewport.
What does toast.tsx depend on?
toast.tsx imports 5 module(s): class-variance-authority, lucide-react, react, react-toast, utils.
Where is toast.tsx in the architecture?
toast.tsx is located at deprecated/www/registry/default/ui/toast.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