You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This example shows how to open a confirm dialog. The `UMB_CONFIRM_MODAL` is a token that represents the confirm dialog. The `open` method takes the token and an object with the data for the confirm dialog. The `onSubmit` method returns a promise that resolves when the user confirms the dialog and rejects when the user cancels the dialog.
8
+
9
+
The confirm modal itself is built-in and does not need to be registered in the extension registry.
10
+
11
+
The modal token describes the options that you can pass to the modal. The confirm modal token has the following properties:
12
+
13
+
*`headline` - The headline of the modal.
14
+
*`content` - The content of the modal, which can be a TemplateResult or a string.
15
+
*`color` - (Optional) The color of the modal. This can be `positive` or `danger`.
16
+
*`confirmLabel` - (Optional) The label of the confirm button.
Copy file name to clipboardExpand all lines: 16/umbraco-cms/customizing/extending-overview/extension-types/modals/confirm-dialog.md
+33-31Lines changed: 33 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,47 +1,48 @@
1
1
---
2
-
description: Ask the user for confirmation
2
+
description: Present a dialog to ask the user for confirmation.
3
3
---
4
4
5
5
# Confirm Dialog
6
6
7
-
{% hint style="warning" %}
8
-
This page is a work in progress and may undergo further revisions, updates, or amendments. The information contained herein is subject to change without notice.
9
-
{% endhint %}
7
+
Confirmation dialogs are used to ask the user for confirmation to complete some action and are presented as a center-aligned modal in the backoffice.
10
8
11
-
This example shows how to open a confirm dialog. The `UMB_CONFIRM_MODAL` is a token that represents the confirm dialog. The `open` method takes the token and an object with the data for the confirm dialog. The `onSubmit` method returns a promise that resolves when the user confirms the dialog and rejects when the user cancels the dialog.
9
+
Extension authors do not need to register the dialog in their extension's manifest, instead these dialogs are opened by importing and calling the `umbOpenModal` function.
12
10
13
-
The confirm modal itself is built-in and does not need to be registered in the extension registry.
14
-
15
-
The modal token describes the options that you can pass to the modal. The confirm modal token has the following properties:
11
+
Extension authors can customize the dialog with configuration options such as headline, body content, colors, and button labels.
16
12
17
13
*`headline` - The headline of the modal.
18
14
*`content` - The content of the modal, which can be a TemplateResult or a string.
19
-
*`color` - (Optional) The color of the modal. This can be `positive` or `danger`.
20
-
*`confirmLabel` - (Optional) The label of the confirm button.
15
+
*`color` - (Optional) The color of the modal, can be `positive` or `danger`. Defaults to `positive`.
16
+
*`confirmLabel` - (Optional) The label of the confirmation button.
17
+
*`cancelLabel` - (Optional) The label of the cancel button.
18
+
19
+
To see all properties of the `UMB_CONFIRM_MODAL` token, see the [API reference](https://apidocs.umbraco.com/v16/ui-api/interfaces/packages_core_modal.UmbConfirmModalData.html).
20
+
21
+
The `onSubmit` method returns a promise that resolves when the user confirms the dialog, and rejects when the user cancels the dialog.
0 commit comments