Components / overlay

State matrix

openrequired
closedrequired

Anatomy

  • modal overlay
  • alertdialog
  • consequence
  • confirm action
  • cancel action
  • error alert

Keyboard contract

Focus is contained; Escape cancels unless confirmation is pending; actions lock during pending work.

Screen-reader contract

role=alertdialog announces the title, consequence, pending state, and rejected confirmation error.

Content rules

  • Name the irreversible consequence.
  • Use explicit confirm and safe cancel labels.

Public API

PropTyperequiredDescription
openbooleanrequiredControlled visibility
onClose() => voidrequiredCancellation callback
onConfirm() => void | Promise<void>requiredDestructive operation
titlestringrequiredAccessible title
childrenReactNoderequiredConsequence and recovery copy
confirmingbooleanExternally controlled pending state
confirmLabelstringLocalized confirmation label
confirmingLabelstringLocalized pending label
cancelLabelstringLocalized cancellation label
confirmationErrorLabelstringLocalized failure announcement

Adaptation contracts

RTL
Use logical action alignment and preserve the safe primary/cancel reading order.
High contrast
Separate overlay, surface, focus, and actions with system-color boundaries.
Reduced motion
Open and close instantly or with opacity only; focus timing remains deterministic.

Verification IDs

AlertDialog/confirm-cancel, AlertDialog/pending-rejection, AlertDialog/escape-focus-restore, AlertDialog/localized-labels

Live

Live

Copyable example

import { AlertDialog } from "@awesome-ds/react";

<AlertDialog open title="Delete" onClose={cancel} onConfirm={remove}>Sure?</AlertDialog>