Skip to main content

TextArea

<ui5-ai-textarea> | Since 2.16.0
info

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

The ui5-ai-textarea component extends the standard TextArea with Writing Assistant capabilities. It provides AI-powered text generation, editing suggestions, and version management functionality.

Structure

The ui5-ai-textarea consists of the following elements:

  • TextArea: The main text input area with all standard textarea functionality
  • WritingAssistant: Dedicated toolbar containing:
    • Versioning: A component with left/right navigation buttons and a label for browsing AI-generated versions
    • AI Button: Opens a menu that can be extended with custom AI generation options through slotting

ES6 Module Import

import "@ui5/webcomponents-ai/dist/TextArea.js";

Basic Sample

Properties

loading

DescriptionDefines whether the ui5-ai-textarea is currently in a loading(processing) state.
Typeboolean
Defaultfalse

promptDescription

DescriptionDefines the prompt description of the current action.
Typestring
Default""

currentVersion

DescriptionIndicates the index of the currently displayed version.
Typenumber
Default0

totalVersions

DescriptionIndicates the total number of result versions available.
Notes: Versioning is hidden if the value is 0
Typenumber
Default0

Slots

DescriptionDefines a slot for ui5-menu integration. This slot allows you to pass a ui5-menu instance that will be associated with the assistant.
TypeHTMLElement

Events

version-change

DescriptionFired when the user clicks on version navigation buttons.
TypeCustomEvent
BubblesNo
CancelableNo

stop-generation

DescriptionFired when the user requests to stop AI text generation.
TypeCustomEvent
BubblesNo
CancelableNo

Methods

No methods available for this component.

CSS Parts

No CSS parts available for this component.

Extended Sample

This extended sample showcases advanced AI TextArea features including multiple AI actions and version management.