Skip to Content
Liquid Glass UI
Components

AlertDialog

Responsive Apple Liquid Glass alert dialog reproducing macOS 27's compact 26px-radius alert with pill buttons on desktop, and automatically adapting to iOS 27's 34px-radius centered Liquid Glass alert with 48px capsule buttons on mobile.

Crafted directly from Apple's official macOS 27 and iOS 27 Sketch UI Kits on top of @base-ui/react/alert-dialog for strict interruption confirmation semantics (blocks accidental backdrop dismissal and requires an explicit choice), adapting via native Tailwind md: breakpoints:

  • Desktop (>= 768px · macOS 27): 26px corner radius, 340px (300px for size="sm") Liquid Glass alert with left-aligned 15px title and 13.5px description, plus 36px full-pill footer buttons (two equal-width side-by-side buttons, automatically stacking vertically for 3 or more).
  • Mobile (< 768px · iOS 27): Centered floating 34px-radius Liquid Glass alert with centered 17px title and description, upgraded to iOS 27's signature 48px full-width capsule buttons stacked vertically (primary action on top, cancel below for one-handed reach).

Responsive Live Preview

Displays the macOS 27 alert by default; click the Mobile icon in the top-right preview toolbar to compare iOS 27's 34px radius and 48px capsule buttons, or drag the sidebar Glass Tint slider to inspect translucency levels:

apple-liquid-ui/preview/alert-dialog-liquid-hero
MacBook · 16:10

Installation (Shadcn Registry)

# Install via the configured @apple-liquid namespace (automatically includes button and liquid-glass)
npx shadcn@latest add @apple-liquid/alert-dialog

# Or install directly via URL
npx shadcn@latest add https://your-domain.com/r/alert-dialog.json

Destructive Confirmation

Pass variant="destructive" to <AlertDialogAction> for macOS 27's soft-red destructive pill button, paired with size="sm" and <AlertDialogMedia> to highlight irreversible actions:

apple-liquid-ui/preview/alert-dialog-destructive
MacBook · 16:10

Stacked Actions

When <AlertDialogFooter> contains 3 or more action buttons, the layout automatically switches from a 2-column row to a vertical stack (matching Apple 27's Sketch Stacked spec):

apple-liquid-ui/preview/alert-dialog-stacked
MacBook · 16:10

Usage

import {
  AlertDialog,
  AlertDialogAction,
  AlertDialogCancel,
  AlertDialogContent,
  AlertDialogDescription,
  AlertDialogFooter,
  AlertDialogHeader,
  AlertDialogTitle,
  AlertDialogTrigger,
} from '@/components/ui/alert-dialog';
import { Button } from '@/components/ui/button';

export function Example() {
  return (
    <AlertDialog>
      <AlertDialogTrigger render={<Button variant="destructive">Delete Backup</Button>} />
      <AlertDialogContent size="sm">
        <AlertDialogHeader>
          <AlertDialogTitle>Permanently delete this backup?</AlertDialogTitle>
          <AlertDialogDescription>
            Historical snapshots cannot be recovered once deleted. This action cannot be undone.
          </AlertDialogDescription>
        </AlertDialogHeader>
        <AlertDialogFooter>
          <AlertDialogCancel>Keep</AlertDialogCancel>
          <AlertDialogAction variant="destructive">Delete</AlertDialogAction>
        </AlertDialogFooter>
      </AlertDialogContent>
    </AlertDialog>
  );
}

Props API

AlertDialogContent

PropTypeDefaultDescription
glassbooleantrueLiquid Glass material reacting to global glass tint; false renders the 100% opaque surface equivalent
size'default' | 'sm''default'Desktop width: default is 340px, sm is 300px

AlertDialogAction / AlertDialogCancel

PropTypeDefaultDescription
variantButtonProps['variant']Action: 'default' / Cancel: 'secondary'Supports all Button semantic variants such as 'default', 'destructive', 'secondary'
glassbooleantrueSame as Button; automatically renders as Over-Glass flat fill inside the dialog
disableMotionbooleanfalseDisable the button press spring animation

On this page