Component v1.1.0 Overlays

Confirmation Workflows

Queued Promise-based confirmation service and accessible host dialog with typed outcomes, safe focus, exact-text guards, and explicit dismissal policy.

API Stable 2.1 WCAG notes Ready Dark mode
Selector
ui-confirmation-dialog
Package
@ngnova/ui/confirmation

Import

Standalone Tailwind v4
import { UiConfirmationDialogComponent, UiConfirmationService } from '@ngnova/ui/confirmation';

Usage & variants

Live examples use the public ui-confirmation-dialog API, paired with the exact snippet a product team would paste into an Angular app.

API Reference

Guarded release deletion

Queued Promise-based confirmation service and accessible host dialog with typed outcomes, safe focus, exact-text guards, and explicit dismissal policy.

No destructive action requested.

Production guidance

Use these notes to decide when the component belongs in a product workflow and what to verify before shipping.

When to use

Use when an action needs deliberate acknowledgement before irreversible, expensive, or security-sensitive work.

Watch for

Mount exactly one UiConfirmationDialogComponent near the application shell; destroying it resolves every pending Promise with reason destroyed.

Product recipes

Apply Confirmation Workflows in distinct, copyable product scenarios—not just an isolated component state.

Guarded destructive action

Exact-text verification and a danger intent add friction only where the risk justifies it.

Angular template ui-confirmation-dialog-recipe.example.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// application-shell.component.html
<ui-confirmation-dialog />

// feature.component.ts
const result = await this.confirmations.confirm({
  title: 'Delete workspace?',
  message: 'All projects and deployment history will be removed.',
  confirmLabel: 'Delete workspace',
  intent: 'danger',
  requireText: 'DELETE',
  requireTextLabel: 'Type DELETE to continue',
});

if (result.confirmed) {
  await this.workspaceApi.delete();
}

Leave with unsaved changes

Request confirmation before navigation while making the safe and destructive outcomes explicit.

Angular template ui-confirmation-dialog-recipe.example.html
1
2
3
4
5
6
7
8
9
10
11
12
<ui-button variant="ghost" (pressed)="confirmLeave()">Back to projects</ui-button>

<!-- Component class -->
confirmLeave(): void {
  this.confirmation.confirm({
    title: 'Discard unsaved changes?',
    message: 'Your edits to this release will be lost.',
    confirmText: 'Discard changes',
    cancelText: 'Keep editing',
    variant: 'danger',
  }).then((confirmed) => confirmed && this.navigateBack());
}

API Reference

Inputs and outputs are semver-sensitive public API. Keep examples aligned with this table.

Inputs

confirmLabel 'Confirm'
string

Localized fallback confirm action label.

cancelLabel 'Cancel'
string

Localized fallback cancel action label.

promptLabel 'Confirmation text'
string

Localized fallback exact-text field label.

promptHint 'Type exactly:'
string

Localized exact-text instruction prefix.

queueLabel 'more confirmations pending'
string

Localized suffix for the pending-request count.

restoreFocus true
boolean

Returns focus to the element active before the queue opened.

Outputs

responded OutputEmitterRef<UiConfirmationResult>

Emits user-driven typed outcomes before the service advances its queue.

opened OutputEmitterRef<UiConfirmationRequest>

Emits each request when it becomes active.

closed OutputEmitterRef<UiConfirmationRequest>

Emits each request when it leaves the active dialog.

escapeKeyDown OutputEmitterRef<void>

Emits Escape even when request policy keeps the dialog open.

backdropClick OutputEmitterRef<MouseEvent>

Emits direct backdrop interaction before request policy.

Accessibility

  • The active request uses alertdialog, aria-modal, unique title/description relationships, scroll lock, and a real Tab focus trap.
  • Focus defaults to Cancel for unguarded requests and the exact-text field for guarded requests; confirmation is never the initial focus.
  • Focus returns to the element active before the queue opened after the last request closes.

Keyboard behavior

  • Tab and Shift+Tab stay within the active alertdialog.
  • Escape always emits escapeKeyDown and cancels unless closeOnEscape is false for that request.
  • Buttons and the optional text field retain native Enter, Space, editing, and focus behavior.

Testing guidance

  • Assert FIFO ordering, every result reason, exact-text equality, safe initial focus, trap/restore, scroll cleanup, per-request dismissal policy, destruction cleanup, localization, and UiConfirmationDialogHarness actions.