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 728aa61f_f88f_ee9c_ac2c_b716eaa72f6c["alert.tsx"] 1d141819_425e_b5fd_4c8e_32f7c6a42cf2["react"] 728aa61f_f88f_ee9c_ac2c_b716eaa72f6c --> 1d141819_425e_b5fd_4c8e_32f7c6a42cf2 3d9438e8_7604_787c_4898_907262aff28b["utils"] 728aa61f_f88f_ee9c_ac2c_b716eaa72f6c --> 3d9438e8_7604_787c_4898_907262aff28b 25383e8d_ca91_a50e_c3a8_5f228d02e1df["class-variance-authority"] 728aa61f_f88f_ee9c_ac2c_b716eaa72f6c --> 25383e8d_ca91_a50e_c3a8_5f228d02e1df style 728aa61f_f88f_ee9c_ac2c_b716eaa72f6c fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import * as React from "react"
import { cn } from "@/examples/base/lib/utils"
import { cva, type VariantProps } from "class-variance-authority"
const alertVariants = cva(
"grid gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4 w-full relative group/alert",
{
variants: {
variant: {
default: "bg-card text-card-foreground",
destructive:
"text-destructive bg-card *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current",
},
},
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(
"[&_a]:hover:text-foreground font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3",
className
)}
{...props}
/>
)
}
function AlertDescription({
className,
...props
}: React.ComponentProps<"div">) {
return (
<div
data-slot="alert-description"
className={cn(
"text-muted-foreground [&_a]:hover:text-foreground text-sm text-balance md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_p:not(:last-child)]:mb-4",
className
)}
{...props}
/>
)
}
function AlertAction({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
data-slot="alert-action"
className={cn("absolute top-2 right-2", className)}
{...props}
/>
)
}
export { Alert, AlertTitle, AlertDescription, AlertAction }
Domain
Subdomains
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 DocumentationAtlas domain, Changelog 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/examples/base/ui/alert.tsx (domain: DocumentationAtlas, subdomain: Changelog, directory: apps/v4/examples/base/ui).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free