Vivid API

Text Area

The Text Area component enables users to input longer, multi-line text when more extensive text entry is required.

Labelling

Label Text

The label attribute provides a short description of the purpose of the Text Area.

If a visible label can’t be used, provide one using the

aria-label

attribute. This ensures screen readers announce the purpose of the element, making it accessible to all users.

Helper Text

The helper-text attribute provides additional information to help the user enter the correct information.

To add HTML to the helper text, use the helper-text slot.

Placeholder Text

The placeholder attribute provides an example of the type of input the user needs to enter.

Avoid using placeholder text as a substitute for a label. Placeholder text is not a reliable label—it disappears when users type and is not always announced by screen readers. Use a label element to ensure the Combobox is both visually and programmatically associated with a descriptive label.

Character Count

The char-count attribute can be use in combination with the maxlength attribute to provide a visual character count.

Contextual Help

You can add the Contextual Help component using the contextual-help slot. It will be displayed next to the label, providing users additional information.

Value

The value attribute can be used the set the default value for the Text Area input element.

Validation Feedback

Error Text

The error-text attribute provides a custom error message. Any current error state will be overridden by error-text.

Success Text

The success-text attribute provides a custom success message. Any current error state will be overridden by success-text.

Rows

Use the rows attribute to set the number of visible rows of text in the Text Area.

Each addition line added 20px - the font size + line height.

Disabled

The disabled attribute disables the Text Area input element.

Read Only

The readonly attribute prevents the user from changing the Text Area value.