Confirm Dialog

A confirm dialog asks the user to approve or cancel a single action before it proceeds. RhombusConfirmService wraps MatDialog and returns a strict Observable<boolean> — never a Promise, never boolean | undefined — so a backdrop click or Escape both resolve to false. The dialog component is internal; consumers only ever call the service.

Example

When to use

  • Use a confirm dialog for a quick, reversible yes/no decision, especially before a destructive action (“Delete post?”).
  • Reach for it when you need the action to block until the user explicitly approves or cancels, and a single sentence of context is enough to make the decision.

When not to use

  • For a task that needs multiple fields or richer content, build a custom Dialog instead.
  • For passive, non-blocking feedback after an action already ran, use a Toast.
  • For an inline, persistent warning the user doesn't have to dismiss to continue, use an Alert.

Related components

  • Dialog — the general-purpose modal this service is built on.
  • Toast — transient feedback once the action completes.
  • Alert — inline, non-blocking warnings.
  • Button — the trigger that opens the confirmation.

Was this page helpful?