display_input_modal
  • 1 Minute to read

display_input_modal


Article summary

display_input_modal()

This function displays an input modal component.
The input modal component provides a dialog screen asking from the user to enter some information. The component can be used for example to ask the user ‘what is the robot name?’

Reference

Screen Shot 2022-07-07 at 11.12.39 AM.png

Explore more about this component here

Arguments

ArgumentsTypeDefault Value
input_typeenumINPUT_TYPE.TEXTenum to define the type of the input allowed: TEXT or NUMERIC
titlestringtitle of the modal (mandatory)
subtitlestringsubtitle of the modal (optional)
placeholderstringtext that will appeat in the input field before the user enter some data
cancel_textstring"No"cancel text button
submit_textstring"Yes"submit text button
themeenumTHEME_TYPE.DARKenum to define the theme of the screen. Can be DARK or WHITE

Return

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

Example

response = await self.UI.display_input_modal(title="How many boxes?")

self.log.info.print(response)
>>>[{"action": "confirmed", "value": "4"}]

Was this article helpful?

What's Next