Popup Overview

Note:

Currently in the beta phase.

A popup is a modal window typically used to temporarily display information requiring user attention or pending operations while maintaining the current context. Users must complete relevant interactive tasks within the modal popup before exiting the modal mode. Popups can be independent of any component and their content is usually composed of various components such as text, lists, input fields, images, etc., to achieve layout. ArkUI currently provides two types of popup components: fixed-style and custom.

  • Custom Popup: Developers need to pass custom components to fill the popup based on usage scenarios to achieve customized popup content. This mainly includes the basic custom popup (CustomDialog) and the UI component-independent custom popup (openCustomDialog).

  • Fixed-Style Popup: Developers can use fixed-style popups to specify the text content and button operations to be displayed, achieving simple interactive effects. This mainly includes the alert dialog (AlertDialog), list selection popup (ActionSheet), dialog (showDialog), and action menu (showActionMenu).

Usage Scenarios

Name Description
UI Component-Independent Custom Popup (openCustomDialog) Used when users need to dynamically update popup properties within a custom popup.
Basic Custom Popup (CustomDialog) Used when users need to customize the components and content within the popup.
Alert Dialog (AlertDialog) Fixed-style, typically used to display information or operations that users currently need or must pay attention to. For example, responding with a confirmation popup when a user performs a sensitive action.
List Selection Popup (ActionSheet) Fixed-style, used when users need to select from a list of options for attention or confirmation.
Dialog (showDialog) Fixed-style, called when users need to handle asynchronous return results after responding to the popup.
Action Menu (showActionMenu) Fixed-style, called when users need to handle asynchronous return results after responding to the action menu.