Confirm Dialog
Confirm Dialog is a modal Dialog used to confirm user actions.
Content
Confirm Dialog consists of:
-
Title
-
Message
-
Footer
-
“Cancel” button
-
“Reject” button
-
“Confirm” button
-
Each Confirm Dialog should have a title and/or message. The “Confirm” button is shown by default, while the two other buttons aren’t (they must be explicitly enabled to be displayed).
Title
The title should be brief but informative and written in sentence case. It must explain the purpose of the dialog and can be phrased as a statement or question. Avoid ambiguous titles, such as “Are you sure?”. Rich content, such as other components and elements, can also be used in the title.
Messages
The message should contain any information a user might need to make an informed decision.
While it can contain any type of content, Confirm Dialog isn’t meant for collecting user input, except for a Checkbox used for remembering the user’s choice.
Buttons
The buttons in a Confirm Dialog are customizable. You can edit their labels and change their theme variants.
Confirm Button
The “Confirm” button represents primary action and is the only button that’s visible by default. Every dialog needs at least one button.
As the name suggests, its default label is “Confirm”, but it can and should be relabeled based on the use case.
Cancel Button
The “Cancel” button is used in situations where the user must be able to cancel an action altogether, such as confirming irreversible actions like saving or deleting data.
Reject Button
The “Reject” button differs from the “Cancel” button in that it still moves the user forward in their workflow.
For example, if the user tries to leave a view containing unsaved changes, they are typically presented with three options: “Cancel”, “Discard” and “Save”. “Cancel” allows the user to stay put and review their changes. “Discard” (the “Reject” button in this case) gets rid of the changes and the user leaves the view.
Closing
Confirm Dialog can be closed by clicking one of its buttons (all buttons close the dialog by default), or by pressing Esc (which triggers the action associated with the Cancel button if one exists). Closing on Esc can be disabled by setting the noCloseOnEsc property to false.