Alert Dialog
thegridcn/alert-dialogFreeComponent
thegridcn publishes no description for this item.
Install it
npx shadcn@latest add https://thegridcn.com/r/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 "@/components/ui/button"89function AlertDialog({10 ...props11}: React.ComponentProps<typeof AlertDialogPrimitive.Root>) {12 return <AlertDialogPrimitive.Root data-slot="alert-dialog" {...props} />13}1415function AlertDialogTrigger({16 ...props17}: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>) {18 return (19 <AlertDialogPrimitive.Trigger data-slot="alert-dialog-trigger" {...props} />20 )21}2223function AlertDialogPortal({24 ...props25}: React.ComponentProps<typeof AlertDialogPrimitive.Portal>) {26 return (27 <AlertDialogPrimitive.Portal data-slot="alert-dialog-portal" {...props} />28 )29}3031function AlertDialogOverlay({32 className,33 ...props34}: React.ComponentProps<typeof AlertDialogPrimitive.Overlay>) {35 return (36 <AlertDialogPrimitive.Overlay37 data-slot="alert-dialog-overlay"38 className={cn(39 "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",40 className41 )}42 {...props}43 />44 )45}4647function AlertDialogContent({48 className,49 ...props50}: React.ComponentProps<typeof AlertDialogPrimitive.Content>) {51 return (52 <AlertDialogPortal>53 <AlertDialogOverlay />54 <AlertDialogPrimitive.Content55 data-slot="alert-dialog-content"56 className={cn(57 "bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",58 className59 )}60 {...props}61 />62 </AlertDialogPortal>63 )64}6566function AlertDialogHeader({67 className,68 ...props69}: React.ComponentProps<"div">) {70 return (71 <div72 data-slot="alert-dialog-header"73 className={cn("flex flex-col gap-2 text-center sm:text-left", className)}74 {...props}75 />76 )77}7879function AlertDialogFooter({80 className,81 ...props82}: React.ComponentProps<"div">) {83 return (84 <div85 data-slot="alert-dialog-footer"86 className={cn(87 "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",88 className89 )}90// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from thegridcn
All 139 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | thegridcn | Components | Free | 2 deps | |
| Agent Avataragent-avatar | thegridcn | Components | Free | no deps | |
| Alertalert | thegridcn | Components | Free | 1 dep | |
| Announcement Barannouncement-bar | thegridcn | Components | Free | no deps | |
| Anomaly Banneranomaly-banner | thegridcn | Components | Free | no deps | |
| Arrival Panelarrival-panel | thegridcn | Components | Free | no deps | |
| Aspect Ratioaspect-ratio | thegridcn | Components | Free | 1 dep | |
| Avataravatar | thegridcn | Components | Free | 1 dep |
