showInputBox

Opens an input box to ask the user for input.

Parameter

Name Type Description
options InputBoxOptions Configures the behavior of the input box.

Returns

Type Description
Promise<String> A promise that resolves to a string the user provided or to undefined in case of dismissal.

Example

  1. let inputPromise = hx.window.showInputBox({
  2. prompt: "Password",
  3. password: true
  4. });
  5. inputPromise.then((result)=>{
  6. console.log("Password: ",result);
  7. });

InputBoxOptions Attribute list

Options to configure the behavior of the input box UI.

Name Type Description
prompt String The text to display underneath the input box.
value String The value to prefill in the input box.
placeHolder String An optional string to show as placeholder in the input box to guide the user what to type.
password Boolean Controls if a password input is shown. Password input hides the typed text.