Getting started

InstallUsageGuidelinesContributeRelease

Foundation

Navigation

Overlay

Confirmation DialogDrawerFilter MenuMenuTooltip

Confirmation Dialog

Confirmation dialogs are used to confirm a dangerous or destructive action that's about to be performed by the user.

#

#

#

#

#

  • When there's a dangerous or destructive action to perform on behalf of the user.

#

  • Confirmation dialog must never appear on its own without user's interaction (like clicking a button).

#

  • Warn user about the consequences of the action they're about to perform.
  • Use sentence case everywhere.
  • Don't add a dot at the end to title.
  • Title should be the same as a text of a button that confirms the action.
  • Don't add question marks to title.
  • Always end a sentence with a dot in description.
  • Don't ask "Are you sure?". Instead, explain the consequences of this action.
  • Confirm button text must be explicit and avoid generic words like "Confirm", "Submit", "Yes", "Delete". For example, a good button text would be "Delete source".

#

#

NameDefaultDescription
isOpen

boolean

Determines whether dialog is open.

isConfirmButtonDisabled

boolean

Determines whether confirm button is disabled. It's useful when there's additional layer of confirmation inside an alert dialog. For example, there could be a password input for especially dangerous actions or a text input to confirm the name of a resource that gets deleted.

title

string

Dialog title.

children

ReactNode

Dialog content. Use it to warn user about the consequences of the action they're about to perform.

confirmButtonText

string

Text of a button that confirms the action.

variant

"danger" | "warning"

Dialog variant.

onClose

() => void

Callback for when dialog is closed.

onCancel

() => void

Optional callback for when user canceled the action.

onConfirm

() => Promise<void> | void

Callback for when user has confirmed the action.

On this page

  • Usage
  • Danger
  • Warning
  • Guidelines
  • When to use
  • Usage
  • Content
  • Props
  • ConfirmationDialog