Dialog
boldkit/dialogFreeComponent
A window overlaid on the primary window with neubrutalism borders and shadows
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/dialog.jsonSource
1import * as React from 'react'2import * as DialogPrimitive from '@radix-ui/react-dialog'3import { X } from 'lucide-react'4import { cn } from '@/lib/utils'56const Dialog = DialogPrimitive.Root78const DialogTrigger = DialogPrimitive.Trigger910const DialogPortal = DialogPrimitive.Portal1112const DialogClose = DialogPrimitive.Close1314const DialogOverlay = React.forwardRef<15 React.ElementRef<typeof DialogPrimitive.Overlay>,16 React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>17>(({ className, ...props }, ref) => (18 <DialogPrimitive.Overlay19 ref={ref}20 className={cn(21 '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',22 className23 )}24 {...props}25 />26))27DialogOverlay.displayName = DialogPrimitive.Overlay.displayName2829const DialogContent = React.forwardRef<30 React.ElementRef<typeof DialogPrimitive.Content>,31 React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>32>(({ className, children, ...props }, ref) => (33 <DialogPortal>34 <DialogOverlay />35 <DialogPrimitive.Content36 ref={ref}37 className={cn(38 '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%] sm:max-w-[425px]',39 className40 )}41 {...props}42 >43 {children}44 <DialogPrimitive.Close className="absolute right-4 top-4 border-2 border-foreground bg-background p-1 shadow-[4px_4px_0px_hsl(var(--shadow-color))] transition duration-200 hover:translate-x-[4px] hover:translate-y-[4px] hover:shadow-none active:translate-x-[4px] active:translate-y-[4px] active:shadow-none focus:outline-none focus:ring-2 focus:ring-ring disabled:pointer-events-none">45 <X className="h-4 w-4 stroke-[3]" />46 <span className="sr-only">Close</span>47 </DialogPrimitive.Close>48 </DialogPrimitive.Content>49 </DialogPortal>50))51DialogContent.displayName = DialogPrimitive.Content.displayName5253const DialogHeader = ({54 className,55// … 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 | |
| Alert Dialogalert-dialog | boldkit | Components | Free | 1 dep | |
| 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 |
