Skip to main content

upp-dialog

A centered modal shell with a backdrop mask and content projection. It is an embedded alternative to Ionic ModalController: the consumer controls visibility (*ngIf or similar) and projects title, form, and actions inside the panel.

When to Use

Use upp-dialog for short confirmations or compact forms that need a modal overlay without registering a separate Ionic modal. Typical consumers wrap business content (for example account settlement) and listen to OnClose to hide the shell.

The host applies desktop or mobile classes from viewService. On desktop the panel is a centered card; on mobile it fills the viewport.

Demo

Source Code

<h2>upp-dialog</h2>
<p class="demo-description">Centered modal shell with projected content using <code>upp-dialog</code>.</p>

<div class="demo-controls">
<ion-button size="small" (click)="OnOpen()">Open dialog</ion-button>
<ion-button size="small" fill="outline" (click)="OnToggleBackdrop()">
backdropDismiss: {{ backdropDismiss }}
</ion-button>
</div>

<upp-dialog *ngIf="open" [backdropDismiss]="backdropDismiss" (OnClose)="OnClose()">
<div class="dialog-body">
<h3>Confirm action</h3>
<p>Click the backdrop, press Escape, or use the button below to close.</p>
<ion-button expand="block" (click)="OnClose()">Close</ion-button>
</div>
</upp-dialog>

API Reference

upp-dialog

Input / OutputTypeDefaultDescription
backdropDismissbooleantrueWhen true, backdrop click, Enter, and Space emit OnClose.
OnCloseEventEmitter<void>Emitted when the user dismisses the dialog (backdrop when allowed, or Escape).

Host classes: mobile when viewService.Mobile is true; desktop when viewService.Desktop is true.

Content projection: arbitrary markup inside <upp-dialog>…</upp-dialog> is rendered in the centered panel.

CSS variables (on :host):

VariableDefaultDescription
--upp-dialog-panel-width420pxMax width of the desktop panel
--upp-dialog-panel-inset24pxOuter padding around the desktop panel
--upp-dialog-panel-radius10pxBorder radius on desktop
--upp-dialog-z-index12000Stacking order of the overlay