Zephora UI

Overlay

ConfirmDialog

Confirmation modal built on Dialog. Uses role="alertdialog", lands focus on the cancel button and treats Escape as cancel; the backdrop never dismisses it.

Import

import { ConfirmDialog } from "@zephora/react";

Examples

Destructive confirmation

`destructive` renders the confirm button in the danger variant.

Async confirm

Keep the dialog open while the action runs — `loading` shows a spinner on the confirm button.

API

ConfirmDialog props

PropTypeDefaultDescription
openbooleanControlled open state.
onOpenChange(open: boolean) => voidCalled whenever the dialog requests an open state change.
title *ReactNodeHeading of the confirmation.
descriptionReactNodeSupporting text explaining the consequence.
confirmLabelReactNode"Confirm"Label of the confirm button.
cancelLabelReactNode"Cancel"Label of the cancel button.
destructivebooleanfalseRenders the confirm button in the danger variant.
loadingbooleanfalseShows a spinner on the confirm button while the action runs.
onConfirm *() => voidCalled when the user confirms. Closing afterwards is up to the caller.
onCancel() => voidCalled when the user cancels (cancel button or Escape).
unstyledbooleanfalseHeadless mode — skips Zephora styling.

Keyboard

KeyAction
EscapeCancels — fires onCancel and requests close.
Tab / Shift+TabCycles between the cancel and confirm buttons; focus starts on cancel.