Alert Dialog
hextaui/alert-dialogFreeComponent
Modal dialog for important actions or decisions.
Live preview
live · rendered by the registry
Rendered by HextaUI on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://hextaui.com/r/alert-dialog.jsonSource
1"use client";23import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";4import type * as React from "react";5import { cn } from "@/lib/utils";6import { buttonVariants } from "@/registry/new-york/ui/button";78function AlertDialog({9 ...props10}: React.ComponentProps<typeof AlertDialogPrimitive.Root>) {11 return <AlertDialogPrimitive.Root data-slot="alert-dialog" {...props} />;12}1314function AlertDialogTrigger({15 ...props16}: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>) {17 return (18 <AlertDialogPrimitive.Trigger19 data-slot="alert-dialog-trigger"20 type="button"21 {...props}22 />23 );24}2526function AlertDialogPortal({27 ...props28}: React.ComponentProps<typeof AlertDialogPrimitive.Portal>) {29 return (30 <AlertDialogPrimitive.Portal data-slot="alert-dialog-portal" {...props} />31 );32}3334function AlertDialogOverlay({35 className,36 ...props37}: React.ComponentProps<typeof AlertDialogPrimitive.Overlay>) {38 return (39 <AlertDialogPrimitive.Overlay40 className={cn(41 "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 touch-manipulation overscroll-contain bg-black/50 data-[state=closed]:animate-out data-[state=open]:animate-in motion-reduce:animate-none",42 className43 )}44 data-slot="alert-dialog-overlay"45 {...props}46 />47 );48}4950function AlertDialogContent({51 className,52 ...props53}: React.ComponentProps<typeof AlertDialogPrimitive.Content>) {54 return (55 <AlertDialogPortal>56 <AlertDialogOverlay />57 <AlertDialogPrimitive.Content58 className={cn(59 "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%] touch-manipulation gap-4 overscroll-contain rounded-lg border bg-background p-6 shadow-lg data-[state=closed]:animate-out data-[state=open]:animate-in motion-safe:duration-200 motion-reduce:animate-none sm:max-w-lg",60 className61 )}62 data-slot="alert-dialog-content"63 {...props}64 />65 </AlertDialogPortal>66 );67}6869function AlertDialogHeader({70 className,71 ...props72}: React.ComponentProps<"div">) {73 return (74 <div75 className={cn("flex flex-col gap-2 text-center sm:text-left", className)}76 data-slot="alert-dialog-header"77 {...props}78 />79 );80}8182function AlertDialogFooter({83 className,84 ...props85// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from HextaUI
All 139 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | HextaUI | Components | Free | 1 dep | |
| AI Chat Historyai-chat-history | HextaUI | Components | Free | no deps | |
| AI Citationsai-citations | HextaUI | Components | Free | no deps | |
| AI Conversationai-conversation | HextaUI | Components | Free | no deps | |
| AI Error Handlerai-error-handler | HextaUI | Components | Free | no deps | |
| AI File Uploadai-file-upload | HextaUI | Components | Free | no deps | |
| AI Messageai-message | HextaUI | Components | Free | 4 deps | |
| AI Model Selectorai-model-selector | HextaUI | Components | Free | no deps |
