Alert Dialog

Modal that asks the user to confirm a destructive or irreversible action. role=alertdialog with the description announced, initial focus on Cancel, and clicking outside does not count as an answer. ConfirmAttrs takes hx-delete and similar attributes.

Delete with confirmation

Focus starts on Cancel. Clicking outside does not close it: only the two answers or Escape do.

@components.AlertDialog(components.AlertDialogProps{
  ID: "delete", Title: "Delete the protocol?", Description: "This cannot be undone.",
  ConfirmLabel: "Delete", ConfirmAttrs: templ.Attributes{"hx-delete": "/protocols/1"},
})