Dialog

A modal panel window with a close button in the traffic light position.

Installation

pnpm dlx shadcn@latest add @cupertinoui/dialog

The first install also adds the macOS theme. See Installation to set up the registry.

Usage

import {
  Dialog,
  DialogContent,
  DialogDescription,
  DialogHeader,
  DialogTitle,
  DialogTrigger,
} from "@/components/ui/dialog"

<Dialog>
  <DialogTrigger>Open</DialogTrigger>
  <DialogContent>
    <DialogHeader>
      <DialogTitle>New Folder</DialogTitle>
      <DialogDescription>Enter a name for the new folder.</DialogDescription>
    </DialogHeader>
  </DialogContent>
</Dialog>

API Reference

Every part forwards the props of the underlying Base UI Dialog part. The props below are the ones CupertinoUI adds or changes.

DialogContent

PropTypeDescription
showCloseButtonboolean
Default: true
Shows the red close button in the traffic light position.
classNamestringExtra classes, merged with the component's own.