NativeScript 9.1 Released → V8 14.9, Vite 8 HMR, built for rapid agentic visual iteration
Dig in

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>