UI
prompt
Displays a text input dialog
moises.ui.prompt
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
title | string | Yes | Prompt title |
description | string | Yes | Prompt description |
label | string | No | Prompt label |
defaultValue | string | No | Prompt default value |
ctaLabel | string | No | Prompt CTA label |
ctaColor | string | No | Prompt CTA color |
Returns:
Promise<string>
- Promise that resolves with the entered text
Example resolved value:
// When the promise resolves, you get:
"example"
Usage Example
import { initMoisesExtension } from '@moises.ai/extension'
const useMoisesExtension = initMoisesExtension({
id: 'id',
name: 'name',
description: 'description',
icon: 'icon',
version: 'version',
author: 'author'
})
const { moises } = useMoisesExtension()
const userInput = await moises.ui.prompt({
title: "Name",
description: "Enter your name:",
label: "Name",
defaultValue: "John Doe",
ctaLabel: "OK",
ctaColor: "primary"
})
This file is automatically generated. Do not edit manually.