alert.tsx — ui Source File
Architecture documentation for alert.tsx, a tsx file in the ui codebase. 3 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 5c492b21_1d3e_0603_92cf_50ca1b6c11e3["alert.tsx"] 1d141819_425e_b5fd_4c8e_32f7c6a42cf2["react"] 5c492b21_1d3e_0603_92cf_50ca1b6c11e3 --> 1d141819_425e_b5fd_4c8e_32f7c6a42cf2 25383e8d_ca91_a50e_c3a8_5f228d02e1df["class-variance-authority"] 5c492b21_1d3e_0603_92cf_50ca1b6c11e3 --> 25383e8d_ca91_a50e_c3a8_5f228d02e1df 79081a1f_55a3_945a_fb8c_d53d6d3eab81["utils"] 5c492b21_1d3e_0603_92cf_50ca1b6c11e3 --> 79081a1f_55a3_945a_fb8c_d53d6d3eab81 style 5c492b21_1d3e_0603_92cf_50ca1b6c11e3 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 "@/lib/utils"
const alertVariants = cva(
"relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",
{
variants: {
variant: {
default: "bg-card text-card-foreground",
destructive:
"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",
},
},
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(
"col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",
className
)}
{...props}
/>
)
}
function AlertDescription({
className,
...props
}: React.ComponentProps<"div">) {
return (
<div
data-slot="alert-description"
className={cn(
"text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",
className
)}
{...props}
/>
)
}
export { Alert, AlertTitle, AlertDescription }
Domain
Subdomains
Functions
Dependencies
- class-variance-authority
- react
- utils
Source
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, ChartRegistry subdomain.
What functions are defined in alert.tsx?
alert.tsx defines 3 function(s): Alert, 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/new-york-v4/ui/alert.tsx (domain: ComponentRegistry, subdomain: ChartRegistry, directory: apps/v4/registry/new-york-v4/ui).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free