ConfirmDialog

When to use

Use with useConfirm for simple yes/no confirmations. Simpler than building a custom Dialog for each confirmation.

Guidelines

  • Descriptive message: "Are you sure you want to delete this item?" not just "Are you sure?"
  • Label the consequences: Tell users what will happen if they confirm.
  • Danger styling: Use acceptClass for destructive actions so the confirm button looks dangerous.

How it works

import { useConfirm } from "primevue/useconfirm"
const confirm = useConfirm()
confirm.require({
    message: "Are you sure?",
    header: "Delete",
    accept: () => { /* delete */ },
})