POPUP: Modal dialog for essential information or actions
TYPES: Rich Content (default) | Informative (.popup-seamless) | Minimal (.popup-minimal)
ALIGNMENT: Left (default) | Center (.popup-center)
SIZES: Small (.popup-sm) | Default | Large (.popup-lg) | Extra Large (.popup-xl)

Popups block user interaction until dismissed. Use for confirmations, settings panels, and informational dialogs. Supports layered stacking with dimming and configurable dismiss modes.

Type: Rich Content (Default)

Rich Content: Header has a visible bottom border separating it from the body. Body scrolls when content exceeds viewport. Footer stays fixed at the bottom with no top border. Best for settings panels, table configurations, and form inputs.

<div class="tw-popup-panel" role="dialog" aria-modal="true">
  <div class="tw-popup-header">...</div>
  <div class="tw-popup-body">...</div>
  <div class="tw-popup-footer">...</div>
</div>

Type: Informative (.popup-seamless)

Informative: Header flows seamlessly into the body with no border. Best for confirmation dialogs with explanatory text and information popups.

<div class="tw-popup-panel popup-seamless">...</div>

Type: Minimal (.popup-minimal)

Minimal: No header at all — body content starts immediately with extra top padding. Best for simple confirmations with an icon, success messages, and yes/no prompts.

<div class="tw-popup-panel tw-popup-minimal tw-popup-center tw-popup-sm">...</div>

Center Alignment (.popup-center)

Center: Centers text in header, body, and footer. Combine with any type. Best for confirmation dialogs and simple prompts.

<div class="tw-popup-panel popup-center">...</div>

Size Variants

Sizes: .popup-sm (400px) | Default (520px) | .popup-lg (680px) | .popup-xl (860px). All sizes are responsive and shrink gracefully on mobile.

<div class="tw-popup-panel popup-sm"> | <div class="tw-popup-panel"> | <div class="tw-popup-panel popup-lg"> | <div class="tw-popup-panel popup-xl">

Scrollable Body

Scrollable: When body content exceeds the viewport, only the body scrolls. Header and footer remain fixed in place.

Without Close Button

No Close Button: The close button (.popup-close) is optional. Omit it when the user must make an explicit choice from the footer actions. The popup can still be closed via overlay click or Escape key.

Layered Popups (Stacking)

Stacking: When a second popup opens, the first popup is dimmed (.popup-dimmed) and the new overlay is transparent to avoid double-darkening. Closing the top popup un-dims the one underneath. Focus is trapped in the topmost popup.

Dismiss Modes

Dismiss Mode: Controls what happens when the overlay is clicked or Escape is pressed.
data-popup-dismiss-mode-value="single" (default) — Closes only the topmost popup.
data-popup-dismiss-mode-value="all" — Closes all open popups at once.

Real-World: Email Processor

REAL-WORLD: Email Processor — Complex two-column popup-xl
COMPOSES: Popup | Form | Tag Input | RTE | Badge | Table | Tooltip | Button

Demonstrates how popup accommodates dense, multi-section scrollable content. Composes form controls, tag input, rich text editor, badges, toggles, table, and tooltips inside a single popup-xl panel.

<div class="tw-popup-panel popup-xl">
  <div class="tw-popup-header">...</div>
  <div class="tw-popup-body">
    <div class="tw:grid tw:grid-cols-1 tw:lg:grid-cols-2 tw:gap-6">
      <div>...left column...</div>
      <div class="tw:border-l tw:border-neutral-200 tw:pl-6">...right column...</div>
    </div>
  </div>
  <div class="tw-popup-footer">...</div>
</div>

Keyboard & Accessibility

Accessibility: Popups use role="dialog" with aria-modal="true". Focus is trapped inside the popup — Tab cycles through focusable elements and wraps at boundaries. Escape closes the popup. Focus returns to the trigger element on close. Use aria-labelledby to link to the title, or aria-label for minimal popups without a visible title.

Key Action
Escape Closes the topmost popup (or all, based on dismiss mode)
Tab Cycles forward through focusable elements within the popup
Shift + Tab Cycles backward through focusable elements within the popup