Alert Dialog
uiable/alert-dialogFreeComponent
Alert Dialog component.
Live preview
live · rendered by the registry
Rendered by uiable on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://uiable.com/r/alert-dialog.jsonSource
1"use client";23import { ComponentProps } from "react";45import { AlertDialog as AlertDialogPrimitive } from "@base-ui/react/alert-dialog";67import { cn } from "@/lib/utils";8import { Button } from "@/components/ui/button";910function AlertDialog({ ...props }: AlertDialogPrimitive.Root.Props) {11 return <AlertDialogPrimitive.Root data-slot="alert-dialog" {...props} />;12}1314function AlertDialogTrigger({ ...props }: AlertDialogPrimitive.Trigger.Props) {15 return (16 <AlertDialogPrimitive.Trigger data-slot="alert-dialog-trigger" {...props} />17 );18}1920function AlertDialogPortal({ ...props }: AlertDialogPrimitive.Portal.Props) {21 return (22 <AlertDialogPrimitive.Portal data-slot="alert-dialog-portal" {...props} />23 );24}2526function AlertDialogOverlay({27 className,28 ...props29}: AlertDialogPrimitive.Backdrop.Props) {30 return (31 <AlertDialogPrimitive.Backdrop32 data-slot="alert-dialog-overlay"33 className={cn(34 "data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 fixed inset-0 isolate z-50 bg-gray-900/20 duration-100 supports-backdrop-filter:backdrop-blur-xs",35 className36 )}37 {...props}38 />39 );40}4142function AlertDialogContent({43 className,44 size = "default",45 ...props46}: AlertDialogPrimitive.Popup.Props & {47 size?: "default" | "sm";48}) {49 return (50 <AlertDialogPortal>51 <AlertDialogOverlay />52 <AlertDialogPrimitive.Popup53 data-slot="alert-dialog-content"54 data-size={size}55 className={cn(56 "data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 bg-card ring-foreground/10 group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-5 rounded-lg p-5 ring-0 shadow-[0_0_15px_-3px_rgb(0,0,0,0.1)] duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm",57 className58 )}59 {...props}60 />61 </AlertDialogPortal>62 );63}6465function AlertDialogHeader({66 className,67 ...props68}: ComponentProps<"div">) {69 return (70 <div71 data-slot="alert-dialog-header"72 className={cn(73// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from uiable
All 712 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | uiable | Components | Free | 2 deps | |
| Alertalert | uiable | Components | Free | 1 dep | |
| Aspect Ratioaspect-ratio | uiable | Components | Free | no deps | |
| Attachmentattachment | uiable | Components | Free | 2 deps | |
| Avataravatar | uiable | Components | Free | 1 dep | |
| Badgebadge | uiable | Components | Free | 2 deps | |
| Breadcrumbbreadcrumb | uiable | Components | Free | 2 deps | |
| Bubblebubble | uiable | Components | Free | 2 deps |
