9.0 Released! → Native ESM runtimes 🚀, Vite support ⚡️, multi-window apps and more...
Read Announcement

Call Signature

ts
function prompt(message: string, defaultText?: string): Promise<PromptResult>;

Defined in: ui/dialogs/index.d.ts:91

The prompt() method displays a dialog box that prompts the visitor for input.

Parameters

ParameterTypeDescription
messagestringThe text to display in the dialog box.
defaultText?stringThe default text to display in the input box. Optional.

Returns

Promise<PromptResult>

Call Signature

ts
function prompt(options: PromptOptions): Promise<PromptResult>;

Defined in: ui/dialogs/index.d.ts:97

The prompt() method displays a dialog box that prompts the visitor for input.

Parameters

ParameterTypeDescription
optionsPromptOptionsThe options for the dialog box.

Returns

Promise<PromptResult>