Skip to main content

PromptInput

<ui5-ai-prompt-input>
info

The @ui5/webcomponents-ai package is under development and considered experimental - components' APIs are subject to change.

The ui5-ai-prompt-input component allows the user to write custom instructions in natural language, so that AI is guided to generate content tailored to user needs.

Note: The web component is in an experimental state

ES6 Module Import​

`import "@ui5/webcomponents-ai/dist/PromptInput.js

Basic Sample​

Properties​

value​

DescriptionDefines the value of the component.
Typestring
Default""
Since2.0.0

placeholder​

DescriptionDefines a short hint intended to aid the user with data entry when the component has no value.
Typestring | undefined
Defaultundefined
Since2.0.0

label​

DescriptionDefines the label of the input field.
Typestring | undefined
Defaultundefined
Since2.0.0

showClearIcon​

DescriptionDefines whether the clear icon of the input will be shown.
Typeboolean
Defaultfalse
Since2.0.0

showExceededText​

DescriptionDetermines whether the characters exceeding the maximum allowed character count are visible in the component.
If set to false, the user is not allowed to enter more characters than what is set in the maxlength property. If set to true the characters exceeding the maxlength value are selected on paste and the counter below the component displays their number.
Typeboolean
Defaultfalse
Since2.0.0

disabled​

DescriptionDefines whether the component is in disabled state.
Note: A disabled component is completely noninteractive.
Typeboolean
Defaultfalse
Since2.0.0

readonly​

DescriptionDefines whether the component is read-only.
Note: A read-only component is not editable, but still provides visual feedback upon user interaction.
Typeboolean
Defaultfalse
Since2.0.0

maxlength​

DescriptionSets the maximum number of characters available in the input field.
Typenumber | undefined
Defaultundefined
Since2.0.0

valueState​

DescriptionDefines the value state of the component.
Type"None" | "Positive" | "Critical" | "Negative" | "Information"
Default"None"
Since2.0.0

showSuggestions​

DescriptionDefines whether the component should show suggestions, if such are present.
Note: You need to import the InputSuggestions module from "@ui5/webcomponents/dist/features/InputSuggestions.js" to enable this functionality.
Typeboolean
Defaultfalse

Slots​

default​

DescriptionDefines the suggestion items.
Note: The suggestions would be displayed only if the showSuggestions property is set to true.
Note: The <ui5-suggestion-item>, <ui5-suggestion-item-group> and ui5-suggestion-item-custom are recommended to be used as suggestion items.
Note: Importing the Input Suggestions Support feature:
import "@ui5/webcomponents/dist/features/InputSuggestions.js";
automatically imports the <ui5-suggestion-item> and <ui5-suggestion-item-group> for your convenience.
TypeArray<IInputSuggestionItem>

valueStateMessage​

DescriptionDefines the value state message that will be displayed as pop up under the component. The value state message slot should contain only one root element.
Note: If not specified, a default text (in the respective language) will be displayed.
Note: The valueStateMessage would be displayed, when the component is in Information, Critical or Negative value state.
TypeArray<HTMLElement>
Since2.0.0

Events​

submit​

DescriptionFired when the input operation has finished by pressing Enter or AI button is clicked.
TypeCustomEvent
Since2.0.0
BubblesYes
CancelableNo

input​

DescriptionFired when the value of the component changes at each keystroke, and when a suggestion item has been selected.
TypeCustomEvent
Since2.0.0
BubblesYes
CancelableNo

change​

DescriptionFired when the input operation has finished by pressing Enter or on focusout.
TypeCustomEvent
Since2.0.0
BubblesYes
CancelableNo

Methods​

No methods available for this component.

CSS Parts​

No CSS parts available for this component.