Home / Function/ DialogContent() — ui Function Reference

DialogContent() — ui Function Reference

Architecture documentation for the DialogContent() function in dialog.tsx from the ui codebase.

Entity Profile

Dependency Diagram

graph TD
  b694ce64_af49_e99e_280c_13fe2af5a8bb["DialogContent()"]
  227df22f_68bf_2113_9bf8_6cdcdbd26878["dialog.tsx"]
  b694ce64_af49_e99e_280c_13fe2af5a8bb -->|defined in| 227df22f_68bf_2113_9bf8_6cdcdbd26878
  style b694ce64_af49_e99e_280c_13fe2af5a8bb fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/v4/examples/base/ui/dialog.tsx lines 41–79

function DialogContent({
  className,
  children,
  showCloseButton = true,
  ...props
}: DialogPrimitive.Popup.Props & {
  showCloseButton?: boolean
}) {
  return (
    <DialogPortal>
      <DialogOverlay />
      <DialogPrimitive.Popup
        data-slot="dialog-content"
        className={cn(
          "bg-background data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 ring-foreground/10 fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl p-4 text-sm ring-1 duration-100 outline-none sm:max-w-sm",
          className
        )}
        {...props}
      >
        {children}
        {showCloseButton && (
          <DialogPrimitive.Close
            data-slot="dialog-close"
            render={
              <Button
                variant="ghost"
                className="absolute top-2 right-2"
                size="icon-sm"
              />
            }
          >
            <XIcon />
            <span className="sr-only">Close</span>
          </DialogPrimitive.Close>
        )}
      </DialogPrimitive.Popup>
    </DialogPortal>
  )
}

Subdomains

Frequently Asked Questions

What does DialogContent() do?
DialogContent() is a function in the ui codebase, defined in apps/v4/examples/base/ui/dialog.tsx.
Where is DialogContent() defined?
DialogContent() is defined in apps/v4/examples/base/ui/dialog.tsx at line 41.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free