Skip to main content
Version: 2.1.4

ConfirmDialog

3p-core v2.1.4


3p-core / ConfirmDialog

Variable: ConfirmDialog

const ConfirmDialog: React.FunctionComponent<IConfirmDialogProps>

ConfirmDialog is a reusable modal dialog used to collect confirmation from a user, with optional support for comments and additional dynamic fields (e.g., a reason, date, or selection).

It supports validation, dynamic rendering based on field type, and executes a provided callback on confirmation.

Example

<ConfirmDialog
confirmOptions={{
title: "Approve Request",
message: "Are you sure you want to approve?",
onConfirm: (comment, values) => console.log(comment, values),
commentType: 'optional',
additionalFields: [
{ fieldName: 'dueDate', fieldLabel: 'Due Date', fieldType: 'date', required: true }
]
}}
onDismiss={() => setVisible(false)}
/>