alert-dialog
shadcn-zhcndoc/alert-dialogFreeComponent
shadcn-zhcndoc publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by shadcn-zhcndoc on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://shadcn.zhcndoc.com/r/styles/new-york/alert-dialog.jsonSource
1"use client"23import * as React from "react"4import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog"56import { cn } from "@/lib/utils"7import { buttonVariants } from "@/registry/new-york/ui/button"89const AlertDialog = AlertDialogPrimitive.Root1011const AlertDialogTrigger = AlertDialogPrimitive.Trigger1213const AlertDialogPortal = AlertDialogPrimitive.Portal1415const AlertDialogOverlay = React.forwardRef<16 React.ElementRef<typeof AlertDialogPrimitive.Overlay>,17 React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>18>(({ className, ...props }, ref) => (19 <AlertDialogPrimitive.Overlay20 className={cn(21 "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",22 className23 )}24 {...props}25 ref={ref}26 />27))28AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName2930const AlertDialogContent = React.forwardRef<31 React.ElementRef<typeof AlertDialogPrimitive.Content>,32 React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>33>(({ className, ...props }, ref) => (34 <AlertDialogPortal>35 <AlertDialogOverlay />36 <AlertDialogPrimitive.Content37 ref={ref}38 className={cn(39 "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",40 className41 )}42 {...props}43 />44 </AlertDialogPortal>45))46AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName4748const AlertDialogHeader = ({49 className,50 ...props51}: React.HTMLAttributes<HTMLDivElement>) => (52 <div53 className={cn(54 "flex flex-col space-y-2 text-center sm:text-left",55 className56 )}57 {...props}58 />59)60AlertDialogHeader.displayName = "AlertDialogHeader"6162const AlertDialogFooter = ({63 className,64 ...props65}: React.HTMLAttributes<HTMLDivElement>) => (66 <div67 className={cn(68 "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",69 className70 )}71 {...props}72 />73)74// … truncated
What it pulls in
Other registry items
Files it writes
More from shadcn-zhcndoc
All 61 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | shadcn-zhcndoc | Components | Free | no deps | |
| alertalert | shadcn-zhcndoc | Components | Free | no deps | |
| aspect-ratioaspect-ratio | shadcn-zhcndoc | Components | Free | no deps | |
| attachmentattachment | shadcn-zhcndoc | Components | Free | no deps | |
| avataravatar | shadcn-zhcndoc | Components | Free | no deps | |
| badgebadge | shadcn-zhcndoc | Components | Free | no deps | |
| breadcrumbbreadcrumb | shadcn-zhcndoc | Components | Free | no deps | |
| bubblebubble | shadcn-zhcndoc | Components | Free | no deps |
