display_modal
- 1 Minute to read
display_modal
- 1 Minute to read
Article summary
Did you find this summary helpful?
Thank you for your feedback
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
Explore more about this component here
Arguments
Arguments | Type | Default Value | |
---|---|---|---|
type | enum | MODAL_TYPE.INFO | enum to define the type of the modal (info/success/error) |
title | string | title of the modal (mandatory) | |
subtitle | string | subtitle of the modal (optional) | |
content | string | context text of the modal (optional) | |
cancel_text | string | "No" | cancel text button |
submit_text | string | "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?