Skip to content
Kimenpre-v1documentation home
Color scheme

ki-confirmation

Show the request where the person can review it. Use action-specific verbs on both buttons and place the details in the default slot. Explain cost or irreversibility in consequence, which appears as a warning note.

Theme for this example
Color scheme for this example
To
Ana Rivera
Subject
Weekly report
<ki-confirmation
heading="Send this email?"
action="send_email"
approve-label="Send email"
deny-label="Keep draft"
consequence="Recipients will get the message immediately."
remember
remember-label="Allow sending email for the rest of this conversation"
>
<dl>
<dt>To</dt><dd>Ana Rivera</dd>
<dt>Subject</dt><dd>Weekly report</dd>
</dl>
</ki-confirmation>

Handle a decision

Listen for ki-approve or ki-deny on the request. Approval reports a boolean remember preference. The host can honor that preference for the requested action in the current conversation. Route each choice to a declared surface action through trusted host code. Use tone="danger" for destructive approval.

Set state to approved, denied or expired after recording the outcome. Use resolved-by and resolved-at for the name and time in the summary.

Focus and announcements

The group is named by its question and announces new requests politely. Call focusPrompt() when the person is waiting for the assistant. An active editor retains focus. Tab reaches refusal before approval, and Escape leaves the decision pending.

API reference

When to use: Show the exact action and the details a person needs before granting permission. A trusted host maps the two decision events to its declared actions and records the outcome in state.

When not to use: Report a completed action without a preceding request, or block the rest of the interface with a modal decision (use ki-dialog). The displayed action identifier is text and carries no execution authority.

Properties & attributes

AttributePropertyTypeDefaultDescription
actionactionstring–Tool identifier shown to the person and available for reporting by the host.
approve-labelapproveLabelstring–Verb or short phrase that describes what approval does, such as "Send email".
approved-labelapprovedLabelstring'Approved'Localized outcome text when the host marks the request approved.
consequenceconsequencestring | undefined–Cost or irreversible effect to read before deciding, displayed as a warning note.
denied-labeldeniedLabelstring'Denied'Localized outcome text when the host marks the request denied.
deny-labeldenyLabelstring–Verb or short phrase for refusal, such as "Keep draft".
expired-labelexpiredLabelstring'Expired'Localized outcome text when the host marks the request expired.
headingheadingstring–Question naming the proposed action. Provide it before asking for a decision.
rememberrememberbooleanfalseOffers an unchecked preference limited to this action in the current conversation.
remember-labelrememberLabelstring'Allow this action for the rest of this conversation'Localized conversation permission label. Name the specific permission when possible.
resolved-atresolvedAtstring | undefined–Display-ready, localized resolution time from the host, if known.
resolved-byresolvedBystring | undefined–Display-ready name of the person or service that resolved the request, if known.
statestate"approved" | "denied" | "expired" | "pending"'pending'Host-controlled outcome. Resolve after recording a decision or expiring the request.
tonetone"danger" | "neutral"'neutral'Use danger when approval is destructive. Unknown values use neutral.

Events

EventDetail typeDescription
ki-approveCustomEvent<{ remember: boolean }>Explicit approval, with the conversation preference at the time of the decision.
ki-denyCustomEvent<void>Explicit refusal of the pending request.

Methods

MethodDescription
focusPrompt() => Promise<boolean>Moves focus to the pending group and reports success. Call only when the host knows the person was waiting for this request. A focused editor keeps its focus, including editors inside open shadow roots.

Slots

SlotDescription
(default)Details the person needs to make the decision. Use readable text or semantic markup such as a description list.

CSS parts

PartDescription
decisionsThe row of decision controls.
groupThe painted, labelled prompt or outcome surface.
headingThe pending question.
rememberThe label of the conversation preference checkbox.
summaryThe resolved row.

CSS custom properties

The public styling contract of ki-confirmation: reassign these tokens at :root or on a subtree — never override internals.

TokenDescription
--ki-confirmation-backdrop-filterComplete backdrop effect behind the confirmation.
--ki-confirmation-bgSolid raised background of the confirmation prompt and summary.
--ki-confirmation-bg-imageOptional image painted over the solid confirmation background.
--ki-confirmation-borderBoundary of the confirmation surface.
--ki-confirmation-border-widthStroke width of the confirmation boundary.
--ki-confirmation-fgText on the confirmation surface.
--ki-confirmation-gapBlock separation between confirmation rows.
--ki-confirmation-heading-font-familyTypeface of the pending question.
--ki-confirmation-inline-gapSpace between text and controls in a row.
--ki-confirmation-paddingSpace between the prompt's edge and its content.
--ki-confirmation-radiusCorner radius of the confirmation surface.
--ki-density-space-scaleMultiplies every scaled container padding and gap (card, dialog, alert, list, list item, select listbox, tab panel, tooltip).
--ki-density-target-minThe smallest pointer target any density may produce: 24 x 24 CSS px by default and in compact (WCAG 2.5.8 AA), 44 x 44 in touch (WCAG 2.5.5). It floors a shrinking control but never lifts what a control paints: a control painted smaller extends its target to it, invisibly; rows and tabs grow to it (spec 045 A1).
--ki-focus-ring-colorColour of the keyboard focus ring every focusable component draws: 3:1 or more against the page in every theme and scheme.
--ki-focus-ring-offsetGap between a focusable component and its keyboard focus ring.
--ki-focus-ring-widthThickness of the keyboard focus ring every focusable component draws (its outline). One token instead of one per component, so a mode or a theme changes every ring at once.
--ki-surface-primary-med-emsemantic color for surface primary med em.
--ki-typography-family-bodysemantic font family for typography family body.
--ki-typography-family-monosemantic font family for typography family mono.
--ki-typography-line-height-parasemantic dimension for typography line height para.
--ki-typography-size-body-1semantic dimension for typography size body 1.
--ki-typography-size-body-2semantic dimension for typography size body 2.
--ki-typography-visually-hidden-sizeNonzero edge for clipped text available to assistive technology.

Workshop

Open ki-confirmation in Storybook