Home / File/ alert.tsx — ui Source File

alert.tsx — ui Source File

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

File tsx ComponentRegistry UIPrimitives 3 imports 4 functions

Entity Profile

Dependency Diagram

graph LR
  882d063f_ec0f_15f1_59cb_55ab81cfb9ec["alert.tsx"]
  1d141819_425e_b5fd_4c8e_32f7c6a42cf2["react"]
  882d063f_ec0f_15f1_59cb_55ab81cfb9ec --> 1d141819_425e_b5fd_4c8e_32f7c6a42cf2
  25383e8d_ca91_a50e_c3a8_5f228d02e1df["class-variance-authority"]
  882d063f_ec0f_15f1_59cb_55ab81cfb9ec --> 25383e8d_ca91_a50e_c3a8_5f228d02e1df
  8ad666ec_1b20_adda_0392_87a60bdb3a68["utils"]
  882d063f_ec0f_15f1_59cb_55ab81cfb9ec --> 8ad666ec_1b20_adda_0392_87a60bdb3a68
  style 882d063f_ec0f_15f1_59cb_55ab81cfb9ec fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import * as React from "react"
import { cva, type VariantProps } from "class-variance-authority"

import { cn } from "@/registry/bases/base/lib/utils"

const alertVariants = cva("cn-alert w-full relative group/alert", {
  variants: {
    variant: {
      default: "cn-alert-variant-default",
      destructive: "cn-alert-variant-destructive",
    },
  },
  defaultVariants: {
    variant: "default",
  },
})

function Alert({
  className,
  variant,
  ...props
}: React.ComponentProps<"div"> & VariantProps<typeof alertVariants>) {
  return (
    <div
      data-slot="alert"
      role="alert"
      className={cn(alertVariants({ variant }), className)}
      {...props}
    />
  )
}

function AlertTitle({ className, ...props }: React.ComponentProps<"div">) {
  return (
    <div
      data-slot="alert-title"
      className={cn(
        "cn-alert-title [&_a]:hover:text-foreground [&_a]:underline [&_a]:underline-offset-3",
        className
      )}
      {...props}
    />
  )
}

function AlertDescription({
  className,
  ...props
}: React.ComponentProps<"div">) {
  return (
    <div
      data-slot="alert-description"
      className={cn(
        "cn-alert-description [&_a]:hover:text-foreground [&_a]:underline [&_a]:underline-offset-3",
        className
      )}
      {...props}
    />
  )
}

function AlertAction({ className, ...props }: React.ComponentProps<"div">) {
  return (
    <div
      data-slot="alert-action"
      className={cn("cn-alert-action", className)}
      {...props}
    />
  )
}

export { Alert, AlertTitle, AlertDescription, AlertAction }

Subdomains

Dependencies

  • class-variance-authority
  • react
  • utils

Frequently Asked Questions

What does alert.tsx do?
alert.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 alert.tsx?
alert.tsx defines 4 function(s): Alert, AlertAction, AlertDescription, AlertTitle.
What does alert.tsx depend on?
alert.tsx imports 3 module(s): class-variance-authority, react, utils.
Where is alert.tsx in the architecture?
alert.tsx is located at apps/v4/registry/bases/base/ui/alert.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