Alert Dialog
boldkit/alert-dialogFreeComponent
A modal dialog for important confirmations with neubrutalism styling
Live preview
live · rendered by the registry
Rendered by boldkit on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://boldkit.dev/r/alert-dialog.jsonSource
1import * as React from 'react'2import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog'3import { cn } from '@/lib/utils'4import { buttonVariants } from '@/components/ui/button'56const AlertDialog = AlertDialogPrimitive.Root78const AlertDialogTrigger = AlertDialogPrimitive.Trigger910const AlertDialogPortal = AlertDialogPrimitive.Portal1112const AlertDialogOverlay = React.forwardRef<13 React.ElementRef<typeof AlertDialogPrimitive.Overlay>,14 React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>15>(({ className, ...props }, ref) => (16 <AlertDialogPrimitive.Overlay17 className={cn(18 'fixed inset-0 z-50 bg-black/70 ease-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',19 className20 )}21 {...props}22 ref={ref}23 />24))25AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName2627const AlertDialogContent = React.forwardRef<28 React.ElementRef<typeof AlertDialogPrimitive.Content>,29 React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>30>(({ className, ...props }, ref) => (31 <AlertDialogPortal>32 <AlertDialogOverlay />33 <AlertDialogPrimitive.Content34 ref={ref}35 className={cn(36 'fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border-3 border-foreground bg-background p-6 shadow-[8px_8px_0px_hsl(var(--shadow-color))] duration-200 ease-out 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 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]',37 className38 )}39 {...props}40 />41 </AlertDialogPortal>42))43AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName4445const AlertDialogHeader = ({46 className,47 ...props48}: React.HTMLAttributes<HTMLDivElement>) => (49 <div50 className={cn('flex flex-col space-y-2 text-center sm:text-left', className)}51 {...props}52 />53)54AlertDialogHeader.displayName = 'AlertDialogHeader'5556const AlertDialogFooter = ({57 className,58 ...props59}: React.HTMLAttributes<HTMLDivElement>) => (60 <div61 className={cn(62 'flex flex-col-reverse gap-3 sm:flex-row sm:justify-end',63 className64 )}65 {...props}66 />67)68// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from boldkit
All 94 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | boldkit | Components | Free | 2 deps | |
| Alertalert | boldkit | Components | Free | 2 deps | |
| ASCII Shapesascii-shapes | boldkit | Components | Free | no deps | |
| Aspect Ratioaspect-ratio | boldkit | Components | Free | 1 dep | |
| Avataravatar | boldkit | Components | Free | 1 dep | |
| Badgebadge | boldkit | Components | Free | 1 dep | |
| Breadcrumbbreadcrumb | boldkit | Components | Free | 2 deps | |
| Buttonbutton | boldkit | Components | Free | 2 deps |
