snapshot of https://github.com/shadcn-ui/ui.git (main, 2026-09-15; blobs > 131072B omitted)
This commit is contained in:
36
apps/v4/components/callout.tsx
Normal file
36
apps/v4/components/callout.tsx
Normal file
@@ -0,0 +1,36 @@
|
||||
import { cn } from "cn"
|
||||
|
||||
import {
|
||||
Alert,
|
||||
AlertDescription,
|
||||
AlertTitle,
|
||||
} from "@/registry/new-york-v4/ui/alert"
|
||||
|
||||
export function Callout({
|
||||
title,
|
||||
children,
|
||||
icon,
|
||||
className,
|
||||
variant = "default",
|
||||
...props
|
||||
}: React.ComponentProps<typeof Alert> & {
|
||||
icon?: React.ReactNode
|
||||
variant?: "default" | "info" | "warning"
|
||||
}) {
|
||||
return (
|
||||
<Alert
|
||||
data-variant={variant}
|
||||
className={cn(
|
||||
"not-typeset mt-6 w-auto rounded-2xl border-surface bg-surface text-surface-foreground md:-mx-1 **:[code]:border",
|
||||
className
|
||||
)}
|
||||
{...props}
|
||||
>
|
||||
{icon}
|
||||
{title && <AlertTitle>{title}</AlertTitle>}
|
||||
<AlertDescription className="text-card-foreground/80">
|
||||
{children}
|
||||
</AlertDescription>
|
||||
</Alert>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user