display_modal
  • 1 Minute to read

display_modal


Article Summary

display_modal()

This function displays a modal component.
Modals are a variant of dialog used to present critical information or request user input needed to complete a user’s workflow. Modals interrupt a user’s workflow by design. When active, a user is blocked from the on-page content and cannot return to their previous workflow until the modal task is completed or the user dismisses the modal.

Reference

Group 974 (1).png

Explore more about this component here

Arguments

ArgumentsTypeDefault Value
typeenumMODAL_TYPE.INFOenum to define the type of the modal (info/success/error)
titlestringtitle of the modal (mandatory)
subtitlestringsubtitle of the modal (optional)
contentstringcontext text of the modal (optional)
cancel_textstring"No"cancel text button
submit_textstring"Yes"submit text button

Return

Dictionary that contains the action performed by the user.
The action can be: canceled/confirmed/closed.

Example

response = await self.UI.display_modal(title="Oh no!", subtitle="Retry this action?", modal_type=MODAL_TYPE.ERROR)

self.log.info.print(response)
>>>[{"action": "Canceled"}]

Was this article helpful?

What's Next