The ui5-textarea component is used to enter multiple rows of text.
When empty, it can hold a placeholder similar to a ui5-input.
You can define the rows of the ui5-textarea and also determine specific behavior when handling long texts.
Determines when the character counter of the component is displayed. Available options are: - None - The counter is never shown and maxlength acts as a hard cap. - Always - The counter is always visible below the component. - Auto - The counter is shown only when the component is focused, when the character limit is exceeded, or when valueState is Critical or Negative. Space is always reserved to prevent layout shifts. Note: When set to a value other than None, this property takes precedence over the deprecated showExceededText property.
Determines the name by which the component will be identified upon submission in an HTML form. Note: This property is only applicable within the context of an HTML Form element.
Defines the number of visible text rows for the component. Notes: - If the growing property is enabled, this property defines the minimum rows to be displayed in the textarea. - The CSS height property wins over the rows property, if both are set.
Determines 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.
Defines the value state of the component. Note: If maxlength property is set, the component turns into "Critical" state once the characters exceeds the limit. In this case, only the "Negative" state is considered and can be applied.
Defines 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 if the component has valueState of type Information, Critical or Negative.
You can use the maxlength and counterMode properties to define characters limit
and to indicates how many characters are remaining before the limit or exceeding after the limit.
Set counterMode to "Always" to keep the counter permanently visible.
Set counterMode to "Auto" to show the character counter only when the TextArea is focused
or when the character limit is exceeded. The counter is also always visible when
valueState is "Critical" or "Negative". Space for the counter is always reserved to avoid layout shifts.
The deprecated showExceededText Boolean still works and maps to counterMode "Always".
The application can control threshold-based coloring by setting valueState based on character count.