Text area

v4.0

Text areas allow for input that extends across multiple lines.

  • CSS
  • Marko
  • React
Stylized artwork of a Text area.

Anatomy

Text area diagram with 4 elements numbered: 1. Label, 2. Value, 3. Container, 4. Helper text.
  1. Label
  2. Value
  3. Container
  4. Helper text

Properties

Label

Include a label unless another adjacent element already serves that purpose. The label names what the user enters in the field.

  • Use sentence case
  • No ending punctuation
  • Use a noun or noun phrase
  • Aim for 1–3 words
An ‘Item Description’ label above a text area.

Value

The value is the text the user enters and submits with the form. User input replaces any placeholder text after the first character is entered.

Text placed into a ‘Feedback’ text area.

Placeholder text

Placeholder text, or “ghost text,” gives users a hint about the expected input format. Use realistic examples of what a user might enter, not descriptions of the field.

Placeholder disappears when the user starts typing, so don’t use it for instructions or required information.

  • Use sentence case
  • End with ellipsis
Placeholder text inside of an ‘Item description’ text area.

Helper text

Helper text is placed below the field and informs the user of any requirements or disclaimers. It's shown persistently or on focus. Don't repeat the label.

  • Use sentence case
  • No ending punctuation, unless there's more than 1 sentence
  • Keep to one line
Helper text is below the text area and reads “Please share additional information or suggestions”.

Character count

A character counter appears when a character limit is set. It updates in real time as the user types.

Format as xx / n (with spaces for clarity).

A character count indicator is placed within the Helper text area situated below the text area.

Rows

The default number of rows can be customized to increase or decrease the height of the field. The default is 4 rows.

Three text area examples. The first is a ‘Description’ text area with an example of a field 3 rows tall, the second is a ‘Description’ text area with an example of a field 4 rows tall, and the third is a ‘Description’ text area with an example of a field 5 rows tall.

Resize

Web browsers add a resize indicator to the bottom right of text area fields by default. Dragging the corner adjusts the field’s width and height. Resizing can be disabled if the behavior isn’t desirable.

Two text areas. The first is a text area with a fixed height contains text that overflows, the second is a text area with a resize indicator on the bottom right of the text area, resizing the text area to visualize the full set of text in the text area.

Behavior

Overflow

Text area fields overflow top and bottom. While focused, the content will shift to keep the cursor in view as the user enters characters. When the field loses focus, the content will scroll to the beginning. Focusing on the field again returns the user to the end of the content.

Two text areas; the first is a text area with a fixed height contains text that overflows, and the second is a text area in a typing state with the typing cursor in view.

Error messages

Error messages appear below the field when the input doesn't meet the required format or conditions. The error message replaces any existing helper text.

Keep the tone neutral, don’t blame or scare the user. Clearly inform users the requirements so they know how to fix it.

  • Use sentence case
  • No ending punctuation
  • Avoid technical language or filler words like “please”, “sorry”, or “oops”
An error message underneath a text area.

Disabled

Users cannot focus on or change disabled fields. Their availability depends on certain requirements. No value will be submitted from disabled fields.

A text area in the disabled state.

Screen sizes

Small

Text area fields expand the full width of the screen up to the page margins on small screens.

A text area spanning the full width of a Refund screen on the eBay mobile app.

Medium and large

Text area fields expand up to their full width on larger screens. Web devices will have the browser’s native text area resize indicator in the bottom right corner.

A text area spanning the full width of a Refund screen on an eBay large size page.

Best practices

Usage

Do use text area fields when longer values and sentences are encouraged.

‘Message to buyer’ label on a text area.

Don’t use text area fields when the expected value is short. Use a simple text field instead.

‘Email (optional)’ label on a text area.

Specs

A text area component is shown with specs highlighted. Space between the label and text area is 4px, padding to the left and right of content inside of a text area is 16px, padding of the top and bottom of content inside of a text area is 8px, and space between a text area and helper text is 8px.