Modal

Modal overlays — one `<Dialog>` component with `type="default"` for content and `type="confirm"` for alerts.

Installation
$Terminal
npx shadcn@latest add https://sdk-components.thesqd.com/r/dialog.json
Usage
One flat `<Dialog>` component — pass `type="confirm"` for alert-style dialogs (with `cancel` / `action`) or omit `type` for general content modals.
TSImport
import { Dialog } from "@/components/ui/dialog";
TSExample
import { TriangleAlertIcon } from "lucide-react";
import { Button } from "@/components/ui/button";
import { Dialog } from "@/components/ui/dialog";

export function Example() {
  return (
    <Dialog
      type="confirm"
      trigger={
        <Button>
          <TriangleAlertIcon />
          Delete account
        </Button>
      }
      title="Are you absolutely sure?"
      description="This action cannot be undone."
      action={{ label: "Continue" }}
    />
  );
}
Composition
Anatomy of the flat Dialog component and its escape-hatch slot exports.
One flat component, two modes — pick via the `type` prop:

<Dialog />                              (default — content dialogs, dismissable)
├── type="default"                      (or omit)
├── trigger={<Button>…</Button>}
├── title / description
├── footer={<>…</>}                     (any JSX — wrap <DialogClose render={…}> for auto-close)
├── showCloseButton                     (toggle the × in the corner; defaults to true)
├── sidebar={[{ label, items: [{ icon|avatar, label, description, content, action }] }]}
│                                       (settings-13 layout — grouped left nav + section-header panel)
├── initialFocus                        (ref to focus on open, or false to skip)
└── children                            (body)

<Dialog type="confirm" />               (alert / confirm dialogs — blocks backdrop dismiss)
├── trigger
├── title / description                 (rich JSX is fine)
├── cancel={{ label } | <JSX/> | false} (defaults to "Cancel"; `false` to omit)
├── action={{ label, onClick, variant } | <JSX/>}
├── media={<Icon/>}                     (optional featured icon above the title)
├── size="default" | "sm"
└── children                            (extra body between description and footer)

Need a fullscreen layout, multi-step content, or a custom close-button
position? The slot exports — `DialogRoot` and its `{Trigger, Content, Header,
Title, Description, Footer, Close, Cancel, Action, Media}` subcomponents — are
still exported as the escape hatch.
Resume session
Inline icon, structured info block, and two pill actions — the Squad default layout for modal interrupts.
Alert dialog
Blocks the page until the user picks an action. Use for destructive or irreversible confirmations.
Alert dialog with icon
Drop a Lucide icon alongside the title for quick context — good for release notes and announcement-style confirmations.
Alert dialog destructive
Tint the title icon with text-destructive and switch the primary action to the destructive variant.
Sizes
Pass `size="xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl"` to step through Tailwind's `max-w-*` scale. Defaults to `md`.
Settings (sidebar)
A sidebar-13 style settings modal. Pass `sidebar={[{ icon, label, action }]}` to the flat `<Dialog>` — it renders a left nav, swaps the panel heading to the active item's label, fires each item's `action` on select, and shows `children` as the panel body. Pair with a wide `size`.
Fullscreen dialog
Expands to fill the viewport (with a small inset) for immersive content. Uses the slot escape hatch.
API Reference
Props exposed by the flat `<Dialog>` component.

Dialog (shared props)

PropTypeDefaultDescription
type"default" | "confirm""default""default" renders a dismissable content modal with optional footer; "confirm" renders an alert-style dialog that blocks backdrop dismiss and uses `cancel` / `action`.
triggerReactNodeElement that opens the modal — typically a `<Button>`.
titleReactNodeHeading rendered inside the header.
descriptionReactNodeBody copy. Pass JSX for multi-paragraph or rich content.
size"xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl""md"Container max-width — maps to Tailwind's `max-w-*` scale. Use larger sizes for content-heavy modals (file viewers, multi-column forms).
openbooleanControlled open state (forwarded to the root primitive).
onOpenChange(open: boolean) => voidFires when the dialog opens or closes.
contentClassNamestringExtends the popup container class names (e.g. `sm:max-w-4xl!`).
sidebarDialogSidebarItem[] | DialogSidebarSection[]Renders a settings-13 style left sidebar nav. Pass flat items or grouped sections (`{ label, items }`). Each item is `{ icon | avatar, label, description?, content?, action? }`; the active item's `label`/`description` become the page section header and its `content` (or the Dialog's `children`) the body. Pair with a wide `size`.
childrenReactNodeBody content rendered between the header and footer.

Type-specific props

PropTypeDefaultDescription
footerReactNode(`type="default"` only) Footer content. Wrap a `<DialogClose render={<Button/>}>` to auto-close.
showCloseButtonbooleantrue(`type="default"` only) Toggle the × close affordance in the top-right corner.
cancel{ label; variant?; className? } | ReactNode | false"Cancel"(`type="confirm"` only) Cancel button config. Pass `false` to omit.
action{ label; onClick?; variant?; className? } | ReactNode(`type="confirm"` only) Confirm action — pass `{ variant: "destructive" }` for delete-style flows.
mediaReactNode(`type="confirm"` only) Decorative icon / media slot rendered above the title.
initialFocusfalse | RefObject<HTMLElement> | ((openType) => HTMLElement | null | void)Forwarded to the underlying Base UI `Dialog.Popup`. Pass a ref to the element to focus on open, or `false` to skip auto-focus.