Home / Function/ SheetContent() — ui Function Reference

SheetContent() — ui Function Reference

Architecture documentation for the SheetContent() function in sheet.tsx from the ui codebase.

Entity Profile

Dependency Diagram

graph TD
  1803e818_6391_8a65_e221_1b1e330ea350["SheetContent()"]
  b1de0a06_ea6f_22d2_9b3d_1cd4c0b3438e["sheet.tsx"]
  1803e818_6391_8a65_e221_1b1e330ea350 -->|defined in| b1de0a06_ea6f_22d2_9b3d_1cd4c0b3438e
  style 1803e818_6391_8a65_e221_1b1e330ea350 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/v4/registry/new-york-v4/ui/sheet.tsx lines 47–86

function SheetContent({
  className,
  children,
  side = "right",
  showCloseButton = true,
  ...props
}: React.ComponentProps<typeof SheetPrimitive.Content> & {
  side?: "top" | "right" | "bottom" | "left"
  showCloseButton?: boolean
}) {
  return (
    <SheetPortal>
      <SheetOverlay />
      <SheetPrimitive.Content
        data-slot="sheet-content"
        className={cn(
          "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
          side === "right" &&
            "data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",
          side === "left" &&
            "data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",
          side === "top" &&
            "data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",
          side === "bottom" &&
            "data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",
          className
        )}
        {...props}
      >
        {children}
        {showCloseButton && (
          <SheetPrimitive.Close className="ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none">
            <XIcon className="size-4" />
            <span className="sr-only">Close</span>
          </SheetPrimitive.Close>
        )}
      </SheetPrimitive.Content>
    </SheetPortal>
  )
}

Subdomains

Frequently Asked Questions

What does SheetContent() do?
SheetContent() is a function in the ui codebase, defined in apps/v4/registry/new-york-v4/ui/sheet.tsx.
Where is SheetContent() defined?
SheetContent() is defined in apps/v4/registry/new-york-v4/ui/sheet.tsx at line 47.

Analyze Your Own Codebase

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

Try Supermodel Free