# KptConfirm (KptConfirmService + kpt-confirm-container) A confirmation service built on `kpt-dialog`. Same pattern as `KptToastService`. Import: `import { KptConfirmService, KptConfirmContainer } from '@konce-pt/angular';` ## Usage 1. Place `` once in the application (next to ``). 2. Inject `KptConfirmService` and call `confirm(options)` -> Promise. ## The promise always settles Escape and x resolve `false`. A second `confirm()` while one is open resolves the previous one with `false` and shows the new one - one request at a time, and no `await` is left hanging. Without a mounted `` the dialog cannot appear, so in dev mode `confirm()` warns in the console. ## KptConfirmOptions - `message`: string (required); `header?`: string - `acceptLabel?`/`rejectLabel?`: string; `variant?`: 'filled' | 'danger'; `icon?`: string ## i18n The default labels (the header, Confirm, Cancel) come from i18n (the `confirm` namespace); the option fields take priority. English by default; configured through `provideKptI18n` - see `i18n/llms.txt`. ## Example const ok = await this.confirm.confirm({ message: 'Delete this record?', variant: 'danger', acceptLabel: 'Delete', icon: 'alert-triangle', }); if (ok) { /* ... */ } ## Tokens Inherited from `kpt-dialog`; the icon follows the variant (`--kpt-color-danger` / `--kpt-color-primary`). ## Accessibility The window is `role="alertdialog"` named by its header, with the message tied to it through `aria-describedby`, so a screen reader reads the question as soon as it opens. Focus starts on the reject button - the safe answer, so a stray `Enter` deletes nothing. Escape and x reject.