Alert dialog
blok/alert-dialogFreeComponent
A modal dialog that interrupts the user with important content and expects a response.
Install it
npx shadcn@latest add https://blok.sitecore.com/r/alert-dialog.jsonSource
1"use client";23import type { VariantProps } from "class-variance-authority";4import { AlertDialog as AlertDialogPrimitive } from "radix-ui";5import type * as React from "react";67import { buttonVariants } from "@/components/ui/button";8import { cn } from "@/lib/utils";910function AlertDialog({11 ...props12}: React.ComponentProps<typeof AlertDialogPrimitive.Root>) {13 return <AlertDialogPrimitive.Root data-slot="alert-dialog" {...props} />;14}1516function AlertDialogTrigger({17 ...props18}: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>) {19 return (20 <AlertDialogPrimitive.Trigger data-slot="alert-dialog-trigger" {...props} />21 );22}2324function AlertDialogPortal({25 ...props26}: React.ComponentProps<typeof AlertDialogPrimitive.Portal>) {27 return (28 <AlertDialogPrimitive.Portal data-slot="alert-dialog-portal" {...props} />29 );30}3132function AlertDialogOverlay({33 className,34 ...props35}: React.ComponentProps<typeof AlertDialogPrimitive.Overlay>) {36 return (37 <AlertDialogPrimitive.Overlay38 data-slot="alert-dialog-overlay"39 className={cn(40 "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",41 className,42 )}43 {...props}44 />45 );46}4748function AlertDialogContent({49 className,50 ...props51}: React.ComponentProps<typeof AlertDialogPrimitive.Content>) {52 return (53 <AlertDialogPortal>54 <AlertDialogOverlay />55 <AlertDialogPrimitive.Content56 data-slot="alert-dialog-content"57 className={cn(58 "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 px-7 py-5 shadow-lg duration-200 sm:max-w-md",59 className,60 )}61 {...props}62 />63 </AlertDialogPortal>64 );65}6667function AlertDialogHeader({68 className,69 ...props70}: React.ComponentProps<"div">) {71 return (72 <div73 data-slot="alert-dialog-header"74 className={cn("flex flex-col gap-2 text-center sm:text-left", className)}75 {...props}76 />77 );78}7980function AlertDialogFooter({81 className,82 ...props83}: React.ComponentProps<"div">) {84 return (85 <div86 data-slot="alert-dialog-footer"87 className={cn(88// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from blok
All 72 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | blok | Components | Free | 2 deps · 2 files | |
| Action baraction-bar | blok | Components | Free | 1 dep · 2 files | |
| Alertalert | blok | Components | Free | 2 deps · 2 files | |
| Aspect ratioaspect-ratio | blok | Components | Free | 1 dep | |
| Avataravatar | blok | Components | Free | 1 dep | |
| Badgebadge | blok | Components | Free | 2 deps | |
| All componentsblok-components | blok | Components | Free | no deps | |
| Breadcrumbbreadcrumb | blok | Components | Free | 2 deps · 2 files |
