Dialog
UX
View Source
A UX compliant dialog that uses HTMLDialogElement
under the hood.
Props
body
ReactReactNode | string
Body of the dialog to display in the main content area.
cancelText
string
Text to display on the cancel button.
confirmText
string
Text to display on the confirm button.
destroyText
string
Text to display on the destroy button.
dialogRef
ReactMutableRefObject
Create with the React.useRef()
hook and pass the ref to the dialog.
onCancelClick
() => void
Callback fired when the cancel button is clicked.
onCloseClick
() => void
Callback fired when the close (X) button is clicked.
onConfirmClick
() => void
Callback fired when the confirm button is clicked.
onDestroyClick
() => void
Callback fired when the destroy button is clicked.
showCancel
boolean
Determines whether the cancel button is shown.
showDestroy
boolean
Determines whether the destroy button is shown.
subtitle
string
Subtitle of the dialog to display in the header. No subtitle appears if omitted.
title
string
Title of the dialog to display in the header.