Skip to main content

ConfirmDialogProps

note

This type is deducted from Spotify's internal usage. It may not be accurate and may change in the future.

The ConfirmDialogProps object is used to create a confirm dialog.

type ConfirmDialogProps = {
isOpen?: boolean;
allowHTML?: boolean;
titleText: string;
descriptionText?: string;
confirmText?: string;
cancelText?: string;
confirmLabel?: string;
onConfirm?: (event: React.MouseEvent<HTMLButtonElement>) => void;
onClose?: (event: React.MouseEvent<HTMLButtonElement>) => void;
onOutside?: (event: React.MouseEvent<HTMLButtonElement>) => void;
};

Properties

PropertyTypeDescription
isOpenboolean | undefinedBoolean to determine if the dialog should be opened. Defaults to true
allowHTMLboolean | undefinedWhether to allow inline HTML in component text. Defaults to false
titleTextstringDialog title. Can be inline HTML if allowHTML is true
descriptionTextstring | undefinedDialog description. Can be inline HTML if allowHTML is true
confirmTextstring | undefinedConfirm button text
cancelTextstring | undefinedCancel button text
confirmLabelstring | undefinedConfirm button aria-label
onConfirm(event: React.MouseEvent<HTMLButtonElement>) => void | undefinedFunction to run when confirm button is clicked.
The dialog does not close automatically, a handler must be included.
onClose(event: React.MouseEvent<HTMLButtonElement>) => void | undefinedFunction to run when cancel button is clicked.
The dialog does not close automatically, a handler must be included.
onOutside(event: React.MouseEvent<HTMLButtonElement>) => void | undefinedFunction to run when dialog is clicked outside of.
By default, this will run onClose.
A handler must be included to close the dialog.