The **Prompt** module provides APIs for creating and showing toasts, dialog boxes, and action menus.
> **NOTE**
>
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
| duration | number | No | Duration that the toast will remain on the screen. The default value is 1500 ms. The recommended value range is 1500 ms to 10000 ms. If a value less than 1500 ms is set, the default value is used.|
| bottom | <length> | No | Distance between the toast border and the bottom of the screen. |
| message | string\|[Resource](.../ui/ts-types.md#resource-type)<sup>9+</sup>| Yes | Text to display. |
| duration | number | No | Duration that the toast will remain on the screen. The default value is 1500 ms. The recommended value range is 1500 ms to 10000 ms. If a value less than 1500 ms is set, the default value is used.|
| bottom | string\| number | No | Distance between the toast border and the bottom of the screen. |
## prompt.showDialog
...
...
@@ -69,38 +65,34 @@ Shows a dialog box. This API uses a promise to return the result synchronously.
| title | string | No | Title of the text to display. |
| message | string| No | Text body. |
| buttons | Array | No | Array of buttons in the dialog box. The array structure is **{text:'button', color: '\#666666'}**. One to three buttons are supported. The first button is of the **positiveButton** type, the second is of the **negativeButton** type, and the third is of the **neutralButton** type.|
| title | string\|[Resource](.../ui/ts-types.md#resource-type)<sup>9+</sup>| No | Title of the dialog box. |
| message | string\|[Resource](.../ui/ts-types.md#resource-type)<sup>9+</sup>| No | Text body. |
| buttons | Array | No | Array of buttons in the dialog box. The array structure is **{text:'button', color: '\#666666'}**. Up to three buttons are supported. The first button is of the **positiveButton** type, the second is of the **negativeButton** type, and the third is of the **neutralButton** type.|
## ShowDialogSuccessResponse
...
...
@@ -160,7 +147,7 @@ Describes the dialog box response result.
| Name | Type | Description |
| ----- | ------ | ------------------- |
| index | number | Index of the selected button in the array.|
| index | number | Index of the selected button in the **buttons**array.|
## prompt.showActionMenu
...
...
@@ -179,36 +166,31 @@ Shows an action menu. This API uses a callback to return the result asynchronous
| title | string| No | Title of the text to display. |
| buttons | Array | Yes | Array of menu items. The array structure is **{text:'button', color: '\#666666'}**. One to six items are supported. If there are more than six items, extra items will not be displayed.|
| title | string\|[Resource](.../ui/ts-types.md#resource-type)<sup>9+</sup>| No | Title of the text to display. |
| buttons | Array<[Button](#button)> | Yes | Array of menu item buttons. The array structure is **{text:'button', color: '\#666666'}**. Up to six buttons are supported. If there are more than six buttons, extra buttons will not be displayed.|
## ActionMenuSuccessResponse
...
...
@@ -269,4 +247,15 @@ Describes the action menu response result.