Home

Textarea

UsageDevelopment

About

A Text area allows users to enter longer texts or data, such as feedback, detailed explanations, or messages.

Anatomy

A Text area consists the following mandatory and optional elements:

  1. Border
  2. Label
  3. Help icon (optional)
  4. Hint text (optional)
  5. Placeholder text (optional)
  6. Indicator (optional)
  7. Character counter (optional)
  8. Enlarge indicator (optional)

Textarea anatomy.

When to use

Use a Text area when you want to allow users to enter a long text or data.

Textarea with Extra explanation label

Do use a text area for allowing users to use enough characters to explain what they would like to.
Do

Input with Extra explanation label.

Do not use an input to allow users to explain since it might not allow for enough characters to ventilate their thoughts.
Don’t

When not to use

Do not use a Text area when the data required to enter is defined to be short, such as dates, names, URLs, amounts, etc.

Required input with Email address label.

Do use an Input component for short data needs.
Do

Required textarea with Email address label.

Do not use a Text area component for short data needs.
Don’t

Error status

A Text area can receive an error status when it is mandatory and still empty when users try to submit.

Textarea with Enter your explanation error.

Behaviour

Character counter
A Text area can be presented with a character count to show users that there’s a limit of characters that can be added.

Resize indicator
A Text area can be presented with an indicator that shows users that a Text area can be enlarged. A Text area can be resized in height, so vertically.

Textarea with character counter and resize indicator.

Keyboard behaviour

Tab

  • Moves focus to the Icon button (help icon) if showcased first.
  • Then moves to the input.
  • Proceeds to next interactive element, such as another input or to a submit button.

Arrow left/right

  • Moves cursor within the text.

Nesting components

A Text area component can use:

  • Icon component

A Text area component can be used in:

  • Forms pattern
  • Dialog component

Resources

Events

ComponentEventDescriptionDetails
<r-textarea />rInputEmitted immediately after component’s value change.
  • element: HTMLRTextareaElement
  • value: any
rChangeEmitted if components value changes after element loses focus.
rResetOccurs when a form is reset (resets component’s value to initial).