Pilipinas Interface

Foundation

  • Overview
  • Get Started
  • Colors
  • Typography
  • Icons
  • Layout & Spacing
  • States & Feedback
  • Motion & Transitions
  • Expressions

Components

  • Overview
  • Accordion
  • Alert
  • Avatar
  • Badge
  • Banner
  • Breadcrumb
  • Button
  • Card
  • Checkbox
  • Code Block
  • Combobox
  • Command Menu
  • Dialog
  • Popover
  • Progress
  • Radio Group
  • Scroll Area
  • Select
  • Skeleton
  • Switch
  • Table
  • Tabs
  • Text Field
  • Tooltip

Resources

  • Registry

Components

Dialog

A focused interruption for a decision that needs the whole page to stop. Open, close and focus return are owned by the primitive.

Preview

A confirmation dialog should interrupt only the task that needs it. This preview scopes the overlay to the panel instead of the viewport.

<Dialog>
  <DialogTrigger render={<Button>Request a document</Button>} />
  <DialogContent>
    <DialogHeader>
      <DialogTitle>Request a document</DialogTitle>
      <DialogDescription>Review the details before submitting.</DialogDescription>
    </DialogHeader>
  </DialogContent>
</Dialog>

Usage

A short decision that needs the rest of the page to stop.

Do and don't

  • Do. Give it a title and keep one primary action in the footer.
  • Don't. Use it for validation or nest a second modal without a reason.

Composition

Dialog owns the open state. DialogTrigger and DialogClose accept render or asChild so a Button can be the control. DialogContent holds DialogHeader, DialogTitle, DialogDescription and DialogFooter.

Props

  • Dialog: open, defaultOpen, onOpenChange, modal.
  • DialogContent: size="sm" | "lg" | "xl", position="center" | "top", container, showCloseButton.
  • DialogTrigger / DialogClose: render, asChild.

Behavior and states

The backdrop, Escape and outside press close the dialog; a controlled caller can react through onOpenChange. The exit spring is held until it finishes instead of being cut by unmount. Pass container with modal= to scope a dialog to a bounded region, as the preview above does. xl is the canvas for a composed layout with a sidebar beside a panel.

Accessibility

Give every dialog a DialogTitle; add DialogDescription when the purpose needs a sentence. Focus moves into the panel on open and returns to the trigger on close. Keep one primary action in the footer; a destructive action needs a clear, specific label and a route back. Do not nest a second modal without an explicit reason.

Responsive

sm is 400px, lg 540px and xl 880px, each one step narrower inside a compact region. For a bounded preview, pair container with a relatively positioned, overflow-hidden wrapper.

Related

States & Feedback defines when a condition should interrupt, and Motion & Transitions explains the open and close timing.

← PreviousCommand MenuNext →Popover

Install

npx shadcn@latest add @pilipinas/dialog

For your coding agent