sheengemologic ui
All components

ConfirmDialog

A controlled confirmation decision with safe initial focus.@gemologic/sheen · overlays

Playground

This example has no scalar controls. Its validated source remains interactive below.
<><Button onClick={() => { void decision.confirm({ title: "Remove workspace?", description: "Saved views will be removed.", tone: "danger" }); }}>Review removal</Button><decision.Dialog /></>

Variant matrix

Imperative confirmation

Anatomy

Package
@gemologic/sheen
Source
packages/ui/src/primitives/ConfirmDialog.tsx
Tokens
  • --sheen-color-bg-raised
  • --sheen-color-focus-ring
  • --sheen-elevation-modal

Accessibility

Role: alertdialogKeyboard: Tab, Shift+Tab, Enter, Space, Escape

Do

  • Mount the controller Dialog once in the creating owner's theme scope.

Do not

  • Do not start irreversible work before the confirmation promise resolves true.

Generated props

NameTypeDefaultDescription
open *booleanApp-owned visibility.
onConfirm *() => voidAffirmative decision callback. The app owns closing and subsequent operations.
onCancel *() => voidCancellation callback for the safe action or Escape. Outside clicks do not cancel.
confirmLabelstringAffirmative action label, defaulting to the scoped confirm message.
cancelLabelstringSafe action label, defaulting to the scoped cancel message.
tone"accent" | "danger"accentAffirmative action tone.
title *stringRequired visible and accessible title.
contentIdstringOptional unique content ID, forwarded to AlertDialog.
description *stringRequired explanation of the decision and its consequences.
returnFocus(() => HTMLElement | undefined) | undefinedOptional surviving focus target when the prompt closes.
shortcutScopestringUnique modal shortcut scope ID, forwarded to AlertDialog. Open confirmations automatically suspend outer shortcut scopes within ShortcutProvider.
classstringAdditional modal content classes.
Native Solid/HTML attributes remain available and are omitted from this authored-prop view.