jengacore.shadcn registry · Tailwind v4 · Radix and Base UI
Components
shadcn, restyled · @jengacore/sheet

Sheet (side panel)

480px record panel from the right with SheetBody and a three-action SheetFooter; the ID sits in the mono eyebrow.

Separate Radix and Base UI builds

Install

terminal
npx shadcn@latest add @jengacore/sheet

Without the namespace configured: npx shadcn@latest add https://ui.jengacore.com/r/<new-york-v4|base-nova>/sheet.json

Registry dependencies

npm packages

lucide-reactradix-ui@base-ui/react

Source

components/ui/sheet.tsx
"use client"

import * as React from "react"
import { XIcon } from "lucide-react"
import { Dialog as SheetPrimitive } from "radix-ui"

import { cn } from "@/lib/utils"

/**
 * Side panel for record detail (an alert, a transfer, a participant, a member): 480px from the right,
 * so the queue stays in view. Slides 24px + fades over 320ms; Esc and × close it.
 * Anatomy: SheetHeader (SheetDescription as the mono ID eyebrow, then SheetTitle) → SheetBody → SheetFooter
 * with up to three actions in the order outline · secondary · destructive.
 */
function Sheet(props: React.ComponentProps<typeof SheetPrimitive.Root>) {
  return <SheetPrimitive.Root data-slot="sheet" {...props} />
}

function SheetTrigger(props: React.ComponentProps<typeof SheetPrimitive.Trigger>) {
  return <SheetPrimitive.Trigger data-slot="sheet-trigger" {...props} />
}

function SheetClose(props: React.ComponentProps<typeof SheetPrimitive.Close>) {
  return <SheetPrimitive.Close data-slot="sheet-close" {...props} />
}

function SheetPortal(props: React.ComponentProps<typeof SheetPrimitive.Portal>) {
  return <SheetPrimitive.Portal data-slot="sheet-portal" {...props} />
}

function SheetOverlay({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Overlay>) {
  return (
    <SheetPrimitive.Overlay
      data-slot="sheet-overlay"
      className={cn(
        "fixed inset-0 z-50 bg-navy-950/35 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=closed]:animate-out data-[state=closed]:fade-out-0",
        className
      )}
      {...props}
    />
  )
}

const SIDE = {
  right: "inset-y-0 right-0 h-full w-[min(480px,100vw)] border-l data-[state=open]:slide-in-from-right-6 data-[state=closed]:slide-out-to-right-6",
  left: "inset-y-0 left-0 h-full w-[min(480px,100vw)] border-r data-[state=open]:slide-in-from-left-6 data-[state=closed]:slide-out-to-left-6",
  top: "inset-x-0 top-0 h-auto border-b data-[state=open]:slide-in-from-top-6 data-[state=closed]:slide-out-to-top-6",
  bottom: "inset-x-0 bottom-0 h-auto border-t data-[state=open]:slide-in-from-bottom-6 data-[state=closed]:slide-out-to-bottom-6",
}

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"
        data-side={side}
        className={cn(
          "fixed z-50 flex flex-col border-border bg-card text-card-foreground shadow-pop outline-none contrast:border-input",
          "duration-enter ease-jc data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=closed]:animate-out data-[state=closed]:fade-out-0",
          SIDE[side],
          className
        )}
        {...props}
      >
        {children}
        {showCloseButton ? (
          <SheetPrimitive.Close
            data-slot="sheet-close"
            className="absolute top-3 right-3 grid size-8 place-items-center rounded-md text-muted-foreground transition-colors duration-fast hover:bg-accent hover:text-foreground focus-ring"
          >
            <XIcon className="size-4 stroke-[1.75]" />
            <span className="sr-only">Close panel</span>
          </SheetPrimitive.Close>
        ) : null}
      </SheetPrimitive.Content>
    </SheetPortal>
  )
}

function SheetHeader({ className, ...props }: React.ComponentProps<"div">) {
  return <div data-slot="sheet-header" className={cn("flex flex-col gap-1 border-b border-border px-5 pt-5 pr-12 pb-4", className)} {...props} />
}

function SheetBody({ className, ...props }: React.ComponentProps<"div">) {
  return <div data-slot="sheet-body" className={cn("flex-1 overflow-y-auto px-5 py-4", className)} {...props} />
}

function SheetFooter({ className, ...props }: React.ComponentProps<"div">) {
  return (
    <div
      data-slot="sheet-footer"
      className={cn("mt-auto grid auto-cols-fr grid-flow-col gap-2 border-t border-border bg-muted/60 px-5 py-3", className)}
      {...props}
    />
  )
}

function SheetTitle({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Title>) {
  return <SheetPrimitive.Title data-slot="sheet-title" className={cn("text-lg leading-6 font-semibold text-foreground", className)} {...props} />
}

/** Rendered as the mono eyebrow above the title: put the record ID here. */
function SheetDescription({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Description>) {
  return <SheetPrimitive.Description data-slot="sheet-description" className={cn("eyebrow order-first", className)} {...props} />
}

export { Sheet, SheetTrigger, SheetClose, SheetPortal, SheetOverlay, SheetContent, SheetHeader, SheetBody, SheetFooter, SheetTitle, SheetDescription }