Skip to content

OrigamDialogConfirmation ​

⛔ Written 2026-08-31 (issue #419) — this file used to be a literal stub ("This file is a stub. The component's prop surface is exercised in stories/…"). <OrigamDialogConfirmation> wraps <OrigamDialog> with a built-in Cancel/Validate footer and a validate-after-read accessibility gate; it is not exercised only by its story, it has a real, documented API below.

Basic usage ​

vue
<template>
    <OrigamDialogConfirmation v-model="open" title="Delete this item?">
        <template #activator="{ props: a }">
            <OrigamBtn v-bind="a">Delete</OrigamBtn>
        </template>
        <template #content>This action cannot be undone.</template>
    </OrigamDialogConfirmation>
</template>

Props ​

IDialogConfirmationProps extends IDialogProps — every prop <OrigamDialog> accepts (fullscreen, retainFocus, persistent, size, status, color/bgColor, rounded, border*, title/subtitle/text/image, width/height, closeLabel, …, see the OrigamDialog Props table) is forwarded to the inner <OrigamDialog> via filterProps, plus its own props:

PropTypeDefaultDescription
cancellablebooleantrueShows the Cancel button in the built-in footer. When false, only Validate is rendered.
cancelTextKeystringorigam.dialog.confirmation.canceli18n key for the Cancel label — not the final string. The component translates it.
validateTextKeystringorigam.dialog.confirmation.validatei18n key for the Validate label. Same rule.

⛔ Changed. Both labels used to be hardcoded in the template (text="Cancel", text="Validate") with no prop to change them — the interface exposed only cancellable. A non-English consumer could neither translate nor rename them except by replacing the whole footer through the #footer slot. On a confirmation dialog — the one asking the user to approve an action — that is the worst possible place for it.

⚠️ It survived because no tool could see it: the C8 detector of the inspection grid only scans aria-label, title, placeholder and alt, so a string passed as a display prop escapes it entirely. Three such cases existed in the whole repo; this is two of them.

Emits ​

NamePayloadWhen
validateMouseEvent | undefinedThe built-in Validate button is clicked. Closes the dialog (isActive.value = false) immediately after.
cancelMouseEvent | undefinedThe built-in Cancel button is clicked (only reachable when cancellable). Closes the dialog immediately after.
update:modelValuebooleanForwarded from the inner <OrigamDialog> — open/close state.

Slots ​

Same chrome slots as <OrigamDialog> (activator, default, loader, header, header-prepend, header-title, header-subtitle, header-content, header-append, asset, text, content), all forwarded as-is, plus:

SlotDescription
footerOverrides the built-in Cancel/Validate row entirely. When omitted, the default footer renders a Cancel button (if cancellable) and a Validate button that stays disabled until the validate-after-read gate opens (see below).

default and header-title are forwarded unscoped here (<slot name="…"/>, no v-bind), unlike <OrigamDialog>'s own scoped versions of those two slots.

Validate-after-read gate ​

The built-in Validate button starts disabled and only becomes clickable once the inner <OrigamDialog> fires its isRead event — i.e. once the dialog's scrollable content has been scrolled into view at least once. This is the same "mark as read" accessibility pattern <OrigamDialog> documents for terms-of-service / consent content: a consumer cannot confirm a destructive or binding action without the content actually having been shown. There is no prop to opt out of this gate; a footer slot override bypasses it entirely (the override owns its own button state).

Accessibility ​

Inherits everything <OrigamDialog> provides (role="dialog", aria-modal, focus trap via retainFocus, ESC to close non-persistent dialogs, closeLabel locale key on the built-in close button) — see OrigamDialog's Accessibility section (voir la doc OrigamDialog).

The Cancel/Validate footer labels are routed through the DS t() locale mechanism, via the cancelTextKey / validateTextKey props above — a footer slot override is no longer needed to translate them. Switching the active locale switches the labels (Cancel/Validate → Annuler/ Valider under fr), pinned in packages/tests/TU/components/Dialog/dialog-contract.spec.ts.

The dialog's accessible name comes from aria-labelledby, which points at the id the inner <OrigamCard> puts on its title element — so passing a plain title is enough to name the dialog, with no extra ARIA. The same spec asserts the reference actually resolves to an existing element, on <OrigamDialogConfirmation> as well as on <OrigamDialog>: a dangling aria-labelledby leaves a confirmation dialog with no accessible name at all, which is exactly where it matters most.

  • OrigamDialog — the base modal this component wraps.