Confirm dialog

A confirm dialog asks once, in a labelled modal, before an action that is hard to undo. It replaces window.confirm and prompt, which cannot be styled, labelled or tested.

Previewapps/web/components/ui/KbConfirmDialog.tsx

Safe and destructive

A destructive dialog starts focus on Cancel and turns the confirm button red.

Destructive
Nothing chosen yet
Show code
confirm({ title: "Delete flow", confirmLabel: "Delete flow", destructive: true })
Plain
Nothing chosen yet
Show code
confirm({ title: "Publish flow", confirmLabel: "Publish flow" })