SYS:ONLINE● ACTIVE
THEME
GITHUBv0.1.0

DIALOG

Modal overlay built on Radix UI. Corner-notched panel with animated entrance. Composable sub-components for header, body, and footer layout.

DEPS:@radix-ui/react-dialog

PREVIEW

INSTALLATION

BASH
npx shadcn@latest add @scificn/dialog

USAGE

TSX
import {
  Dialog, DialogTrigger, DialogContent,
  DialogHeader, DialogTitle, DialogDescription,
  DialogBody, DialogFooter,
} from '@/ui/dialog'
import { Button } from '@/ui/button'

export function Example() {
  return (
    <Dialog>
      <DialogTrigger asChild>
        <Button variant="EXEC">INITIATE SEQUENCE</Button>
      </DialogTrigger>
      <DialogContent>
        <DialogHeader>
          <DialogTitle>SEQUENCE CONFIRMATION</DialogTitle>
        </DialogHeader>
        <DialogBody>
          <DialogDescription>
            Warning: this action cannot be undone. All systems will
            be locked until the sequence completes.
          </DialogDescription>
        </DialogBody>
        <DialogFooter>
          <Button variant="ABORT" size="SM">ABORT</Button>
          <Button variant="EXEC" size="SM">EXECUTE</Button>
        </DialogFooter>
      </DialogContent>
    </Dialog>
  )
}

ANATOMY

DialogRoot — manages open/closed state via Radix.
DialogTriggerWraps the element that opens the dialog.
DialogContentThe panel — renders in a Portal with overlay. Contains close button.
DialogHeaderTop section with bottom border. Place DialogTitle here.
DialogTitleRequired for accessibility. Uppercase monospace heading.
DialogDescriptionOptional body text. Muted color.
DialogBodyMain content area with standard padding.
DialogFooterBottom section with top border. Right-aligns action buttons.
DialogCloseRe-exported Radix close primitive for custom close triggers.

PROPS

PROPTYPEDEFAULTDESCRIPTION
openbooleanControlled open state.
onOpenChange(open: boolean) => voidCallback fired when the dialog opens or closes.
defaultOpenbooleanfalseInitial open state (uncontrolled).
modalbooleantrueWhen true, interaction outside the dialog is blocked.

DialogContent, DialogHeader, DialogBody, DialogFooter extend React.HTMLAttributes<HTMLDivElement>.