Skip to main content
Use this API to show a modal dialog that allows users to enter text input.

Parameters

PropertyTypeRequiredDescription
titleStringNoDialog title
messageStringNoDialog message
placeholderStringNoInput placeholder text
alignStringNoText alignment: left, center, right
okButtonTextStringNoOK button text
cancelButtonTextStringNoCancel button text
successFunctionNoCallback with result

Success Callback

PropertyTypeDescription
okBooleantrue if user tapped OK
inputValueStringThe text entered by user

Code Example

my.prompt({
  title: 'Enter Name',
  message: 'Please enter your name',
  placeholder: 'Your name',
  okButtonText: 'Submit',
  cancelButtonText: 'Cancel',
  success: (result) => {
    if (result.ok) {
      console.log('Name:', result.inputValue);
    }
  }
});

my.confirm

Show confirmation dialog

my.alert

Show alert dialog