ui

Dialog

A popup that opens on top of the entire page. Built with Base UI and Tailwind CSS. Copy-paste ready.

API Reference

Installation

Usage

DialogFooter Variant

The DialogFooter component supports a variant prop to control its styling:

  • default (default): Includes a border-top, background color, and padding
  • bare: Removes the border and background for a minimal appearance

DialogPanel Scrolling

The DialogPanel component automatically wraps its content in a ScrollArea component. This means that if the content exceeds the dialog's maximum height, it will become scrollable automatically. The scrollbar will appear when needed, providing a smooth scrolling experience.

Examples

Open from a Menu

Demonstrates triggering a Dialog from a MenuItem, allowing dialogs to be opened as secondary actions from dropdowns.

Uses DialogFooter variant="bare" to remove the border and background from the footer for a minimal, form-like appearance.

With Scroll

Tall content inside DialogPanel becomes automatically scrollable via the built-in ScrollArea wrapper.

Nested Dialogs

Opens a second dialog from within an already-open dialog, demonstrating stacked overlay behavior and layered focus trapping.

With Destructive Action

A confirmation dialog with a red destructive button for irreversible actions like permanently deleting content.

A settings dialog with toggle switches for managing cookie consent categories such as analytics and marketing.

Session Expired

A blocking dialog notifying the user their session has timed out, with a single "Sign in again" action button.

Edit Profile

A dialog form for updating a user profile that includes an avatar upload area and editable input fields.

Invite Team Members

A dialog for inviting users by email with a role selector and a scrollable list of pending invites.

Share Document

A share dialog with a copyable link field, a one-click copy button that switches to a checkmark on success, and permission-level selector tiles.

Two-Factor Authentication Setup

A 2FA setup dialog displaying a simulated QR code placeholder and a six-digit code entry — verifying the code locks the input and shows a success state.

Subscription Cancellation

A cancellation dialog prompting the user to choose a reason before confirming — the destructive action stays disabled until a reason is selected.

API Key Generation

Generates a new secret API key with mask/reveal toggle, one-click copy with confirmation feedback, and a regenerate button — all within a secure disclosure flow.

Product Feedback Rating

A star-rating feedback form for multiple product aspects (Ease of use, Performance, Design, Support) with an optional comment textarea — Submit stays disabled until every category is rated.