dialog
neobrutalui/dialogFreeComponent
Display focused content in a modal overlay.
Live preview
live · rendered by the registry
Rendered by neobrutalui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://www.neobrutalui.live/r/dialog.jsonSource
1"use client"23import * as React from "react"4import { Dialog as BaseDialog } from "@base-ui/react/dialog"5import { X } from "lucide-react"6import { cn } from "@/lib/utils"78const Dialog = BaseDialog.Root910const DialogTrigger = BaseDialog.Trigger1112const DialogPortal = BaseDialog.Portal1314const DialogClose = BaseDialog.Close1516type DialogOverlayProps = React.ComponentPropsWithoutRef<typeof BaseDialog.Backdrop>1718const DialogOverlay = React.forwardRef<19 React.ComponentRef<typeof BaseDialog.Backdrop>,20 DialogOverlayProps21>(({ className, ...props }, ref) => (22 <BaseDialog.Backdrop23 ref={ref}24 className={cn(25 "fixed inset-0 z-50 bg-black opacity-80 transition-opacity data-ending-style:opacity-0 data-starting-style:opacity-0",26 className27 )}28 {...props}29 />30))31DialogOverlay.displayName = "DialogOverlay"3233type DialogContentProps = React.ComponentPropsWithoutRef<typeof BaseDialog.Popup>3435const DialogContent = React.forwardRef<36 React.ComponentRef<typeof BaseDialog.Popup>,37 DialogContentProps38>(({ className, children, ...props }, ref) => (39 <DialogPortal>40 <DialogOverlay />41 <BaseDialog.Popup42 ref={ref}43 className={cn(44 "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border-2 border-black bg-white p-6 shadow-brutal duration-200 transition-opacity motion-reduce:transition-none data-ending-style:scale-95 data-ending-style:opacity-0 data-starting-style:scale-95 data-starting-style:opacity-0 rounded-base",45 className46 )}47 {...props}48 >49 {children}50 <BaseDialog.Close aria-label="Close dialog" className="absolute right-4 top-4 rounded-base opacity-70 transition-opacity hover:opacity-100 focus-brutal disabled:pointer-events-none">51 <X className="h-4 w-4" />52 <span className="sr-only">Close</span>53 </BaseDialog.Close>54 </BaseDialog.Popup>55 </DialogPortal>56))57DialogContent.displayName = "DialogContent"5859const DialogHeader = ({60 className,61 ...props62}: React.HTMLAttributes<HTMLDivElement>) => (63 <div64 className={cn(65 "flex flex-col space-y-1.5 text-center sm:text-left",66 className67 )}68 {...props}69 />70)71DialogHeader.displayName = "DialogHeader"7273const DialogFooter = ({74// … truncated
What it pulls in
npm packages
Other registry items
More from neobrutalui
All 24 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | neobrutalui | Components | Free | 2 deps | |
| alertalert | neobrutalui | Components | Free | 1 dep | |
| avataravatar | neobrutalui | Components | Free | no deps | |
| badgebadge | neobrutalui | Components | Free | 1 dep | |
| buttonbutton | neobrutalui | Components | Free | 1 dep | |
| cardcard | neobrutalui | Components | Free | no deps | |
| checkboxcheckbox | neobrutalui | Components | Free | 2 deps | |
| date-pickerdate-picker | neobrutalui | Components | Free | 2 deps |
