TextArea receives much longer user text input to complete a form.

Anatomy

  • Required
  • Optional
Anatomy elements
#RequiredElementDescription
1ContainerWrapper that includes the field, label, and assistive text.
2NoLabelDescribes the purpose of the TextArea. Accepts rich content like icons or optional indicators.
3FieldAccepts freeform, multi-line text input. Can show a placeholder if empty.
4NoResize handleLets the user drag the field for more visual room. Can be removed, and is hidden when the field grows with its content.
5NoAssistive textDisplays description or error text to aid the user.

Guidelines

When to use

TextAreas accept longer, multi-line text such as descriptions, messages, notes, and feedback. Use a TextArea when user input is expected to exceed a single line or when line breaks are essential to the value.

TextAreas are commonly used in feedback and support forms, where an open-ended question needs room for a complete answer. For shorter, single-line values, use the TextField instead.

Best practices

Height

Size the TextArea to the length of the response expected. A field that is too short hides what the user has written, and one that is too tall suggests a longer answer than needed and takes up more vertical space. Three to five rows suit most descriptions and messages.

Do: Show enough rows to fit a typical response.
Don't: Use a single row for multi-line text.

Labels and placeholders

While not explicitly required, we highly recommend providing a visible label so users understand the purpose of the TextArea at a glance. If visible labels aren't possible or needed, be sure to provide an accessible label.

For more information on labels and accessibility, see Labels under the Accessibility tab.

Do: Include a visible label that describes the expected content.
Don't: Use placeholders in place of visible labels.

Customization

In adhering with Pluma's focus on flexibility, the TextArea component includes customization options beyond plain text. Customization is useful for adding richer label content or building custom assistive text.

Custom description

Descriptions are assistive text that display below the field. They can accept rich content including links.

Custom description with link

A description with an inline link directs users to additional resources.

Custom error

Error messages are assistive text that display below the field. They accept rich content, allowing the inclusion of links or formatted text that better help users resolve the issue.

Error with link

An error message with a link directs users to relevant documentation or support.

Custom label

The label accepts rich content, allowing supplementary elements such as optional indicators alongside the label text.

Label with optional text

Supplementary text clarifies that the field is not required.

Appearance

Height

The TextArea displays two rows by default. Set a different number of rows to match the length of the expected response.

Default

The default height suits short descriptions and notes.

Custom rows

A taller field suits longer content such as message bodies or instructions.

Resize

A resize handle in the bottom corner lets the user drag the field to change how many rows are visible. Remove the handle when the field sits in a fixed layout where a taller field would push other content out of place. Allow horizontal resizing only when the field is not full width.

Vertical

The default handle lets the user make the field taller to review what they've written.

None

Removing the handle keeps the field at a fixed height within a constrained layout.

Horizontal

The user can widen or narrow the field when it has a set width, while its height stays fixed.

Both

The user can resize the field in either direction when it has a set width.

Width

The TextArea normally stretches to fill its parent container but can be set to a fixed width. Consider a fixed width when the field sits inline with other inputs or elements.

Full width

Full width suits most forms, where the field aligns with the controls above and below it.

Fixed width

A fixed width suits fields that sit inline with other content.

Behaviors

States

Base

The TextArea has default input styling in its base resting state.

Hover

Border color updates on mouse hover to signal the field is interactive.

Focus

On keyboard focus, the field receives the standard 2px focus ring and the border color updates.

Active

Active styles apply when the user interacts with the field.

Disabled

Disabled fields cannot be interacted with. Background and text color update to indicate the field is unavailable.

Critical

The TextArea adopts critical styling to indicate there's an error. An error message displays below the field when set.

Auto-grow

A TextArea can grow with its content, starting at a minimum number of rows and expanding as the user types until it reaches a maximum. Once the content exceeds the maximum, the field scrolls. Use auto-grow for prompts and messages where the length of the response varies widely, so short entries stay compact and long ones remain readable.

The resize handle is hidden while the field grows with its content.

Auto-grow

The field starts at two rows and grows to six as the user types.

Submit on Enter

By default, Enter inserts a new line. The TextArea can instead submit its form on Enter, while Shift+Enter inserts a new line. Reserve this for chat-style inputs where the user expects to send each entry quickly. State the behavior in the description.

For more information, see Submitting under the Accessibility tab.

Do: Explain how to send and how to add a new line.
Don't: Submit on Enter in a form field where line breaks are expected.

Content

Assistive text

Assistive text displays below the TextArea and gives the user information about the form field they're interacting with. Assistive text comes in different forms including descriptions and error text.

Description

Use description text to explain what the content is used for, what it should include, or any length limit. Short, complete sentences are preferred. When the field has a character limit, show the remaining count in the description so the user can see the limit before reaching it.

Do: Explain how the content is used.
Do: Show the character limit as the user types.

Error

Error messages communicate issues the user must resolve before submission. Frame validation errors as direct instructions, not accusations. Be sure to provide guidance on how to fix the error. Keep messages direct and concise. Avoid using "Please".

Do: Describe the problem and how to resolve it.
Don't: Use vague error messages.

Labels

Write clear, concise labels that describe the content the TextArea expects. Nouns and noun phrases are preferred for fields that store data. A direct question works for open-ended feedback where a full answer is expected.

Do: Use a noun that describes the content expected.
Do: Ask a direct question in a feedback form.
Don't: Use instructional phrases.

Placeholders

Placeholders help the user complete a field by showing an example of the content it expects. Begin example text with "e.g." so it doesn't read as a value already entered. For most TextArea use cases, we recommend leaving the placeholder empty. A blank field makes it clearer to users that the field hasn't been prefilled.

Do: Use placeholders to show an example response.
Don't: Repeat the label as placeholder text.