Customized Header Alert Dialog
shadcn-ui-blocks/alert-dialog-05FreeComponent
An alert dialog with customized header
Install it
npx shadcn@latest add https://shadcnui-blocks.com/r/alert-dialog-05.jsonSource
1import { OctagonAlert, X } from "lucide-react";2import { AlertDialog as AlertDialogPrimitive } from "radix-ui";3import {4 AlertDialog,5 AlertDialogAction,6 AlertDialogCancel,7 AlertDialogContent,8 AlertDialogDescription,9 AlertDialogFooter,10 AlertDialogHeader,11 AlertDialogTitle,12 AlertDialogTrigger,13} from "@/registry/ui/alert-dialog";14import { Button } from "@/registry/ui/button";1516export default function AlertDialogWithCustomizedHeader() {17 return (18 <AlertDialog>19 <AlertDialogTrigger asChild>20 <Button variant="outline">Show Dialog</Button>21 </AlertDialogTrigger>22 <AlertDialogContent>23 <div className="-mx-4 -mt-1 flex items-center justify-between border-b px-4 pb-3">24 <AlertDialogTitle>Delete Account</AlertDialogTitle>25 <AlertDialogPrimitive.Cancel asChild>26 <Button size="icon-sm" variant="ghost">27 <X />28 </Button>29 </AlertDialogPrimitive.Cancel>30 </div>31 <AlertDialogHeader className="pt-2">32 <AlertDialogTitle>33 <div className="mx-auto mb-4 flex h-9 w-9 items-center justify-center rounded-full bg-destructive/10 sm:mx-0">34 <OctagonAlert className="h-5 w-5 text-destructive" />35 </div>36 Are you absolutely sure?37 </AlertDialogTitle>38 <AlertDialogDescription className="text-[15px]">39 This action cannot be undone. This will permanently delete your40 account and remove your data from our servers.41 </AlertDialogDescription>42 </AlertDialogHeader>43 <AlertDialogFooter className="mt-2">44 <AlertDialogCancel variant="ghost">Cancel</AlertDialogCancel>45 <AlertDialogAction variant="destructive">Continue</AlertDialogAction>46 </AlertDialogFooter>47 </AlertDialogContent>48 </AlertDialog>49 );50}
What it pulls in
npm packages
Other registry items
Files it writes
More from Shadcn UI Blocks
All 542 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Default Accordionaccordion-01 | Shadcn UI Blocks | Components | Free | no deps | |
| Outline Accordionaccordion-02 | Shadcn UI Blocks | Components | Free | no deps | |
| Box Accordionaccordion-03 | Shadcn UI Blocks | Components | Free | no deps | |
| Contained Accordionaccordion-04 | Shadcn UI Blocks | Components | Free | no deps | |
| Box Contained Accordionaccordion-05 | Shadcn UI Blocks | Components | Free | no deps | |
| Tabs Accordionaccordion-06 | Shadcn UI Blocks | Components | Free | no deps | |
| Highlight Active Item Accordionaccordion-07 | Shadcn UI Blocks | Components | Free | no deps | |
| Multiple Expanded at a time Accordionaccordion-08 | Shadcn UI Blocks | Components | Free | no deps |
