Skip to Content
Liquid Glass UI
Components

Dialog

Apple Liquid Glass centered dialog with unified desktop and mobile modal presentation, a built-in maximize-to-fullscreen toggle, and fixed header/footer layout with scrollable body.

Fully compatible with the standard shadcn/ui JSX API (<Dialog> / <DialogTrigger> / <DialogContent> / <DialogHeader> / <DialogBody> / <DialogTitle> / <DialogDescription> / <DialogFooter> / <DialogClose>), delivering a unified centered Liquid Glass modal across desktop and mobile:

  • Unified Centered Modal: Powered by @base-ui/react/dialog, rendering a centered 26px-radius Liquid Glass window on both desktop and mobile with soft inner specular highlights, circular top-right controls, and live --liquid-glass-tint reactivity.
  • Maximize to Fullscreen: A built-in maximize/restore button sits to the left of the close button, expanding the dialog to fill the entire viewport (with mobile safe-area padding) and restoring on click.
  • Fixed Header & Footer: DialogHeader stays pinned at the top and DialogFooter stays pinned at the bottom while the middle content automatically takes all remaining height and scrolls independently when overflowing.

Live Preview

Open the dialog to try the centered Liquid Glass modal and top-right maximize toggle, or adjust the sidebar Glass Opacity slider:

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

Installation (Shadcn Registry)

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

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

Share Settings Dialog

Compose Switch, Button, and subtle grouped cards cleanly inside the Liquid Glass surface, or enable showCloseButton on DialogFooter:

apple-liquid-ui/preview/dialog-share-sheet
MacBook · 16:10

Scrollable Long Content & Maximize

Extend width via className (e.g. md:max-w-lg) while the header and footer stay fixed and the middle content fills the remaining height with independent scrolling:

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

Usage

import { Button } from '@/components/ui/button';
import {
  Dialog,
  DialogClose,
  DialogContent,
  DialogDescription,
  DialogFooter,
  DialogHeader,
  DialogTitle,
  DialogTrigger,
} from '@/components/ui/dialog';

export function Example() {
  return (
    <Dialog>
      <DialogTrigger render={<Button variant="secondary">Open Dialog</Button>} />
      <DialogContent>
        <DialogHeader>
          <DialogTitle>Edit Profile</DialogTitle>
          <DialogDescription>
            Changes will sync across all of your devices.
          </DialogDescription>
        </DialogHeader>
        <DialogFooter>
          <DialogClose render={<Button variant="secondary" />}>
            Cancel
          </DialogClose>
          <DialogClose render={<Button variant="default" />}>
            Save Changes
          </DialogClose>
        </DialogFooter>
      </DialogContent>
    </Dialog>
  );
}

Props API

DialogContent

PropTypeDefaultDescription
glassbooleantrueLiquid Glass material reacting to glass tint; false renders a 100% opaque surface
showCloseButtonbooleantrueRender the circular Apple close button top-right
showMaximizeButtonbooleantrueRender the maximize/restore button to the left of the close button
maximizedboolean—Controlled maximized state expanding the dialog to fill the viewport
defaultMaximizedbooleanfalseInitial uncontrolled maximized state
onMaximizedChange(maximized: boolean) => void—Callback fired when the maximized state changes
classNamestring—Customize panel width, radius, or spacing (defaults to md:max-w-md when not maximized)

DialogFooter

PropTypeDefaultDescription
showCloseButtonbooleanfalseAutomatically append a secondary "Close" button in the footer

Language & Text

Dialog accepts locale and messages, which apply to all of its parts and the overlays it opens and win over the global <LiquidGlassProvider locale messages>. To override the text globally, put it under messages.dialog on the provider. See Liquid Glass → Global settings.

PropTypeDescription
localeLiquidGlassLocaleInputUI language of this component (any BCP 47 tag; unsupported ones fall back to English)
messagesPartial<DialogMessages>Text overrides, merged over the built-in text and the global messages.dialog
KeyBuilt-in text (English)
closeClose
maximizeMaximize
restoreRestore

On this page