Skip to main content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.


The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.



Use: Deployed English, Spanish
Textarea allows people to enter any type of text.



View va-textarea in Storybook


View va-textarea error in Storybook

See form error handling for additional guidance.

Max length

View va-textarea max length in Storybook


View va-textarea required in Storybook

Hint text

Refer to the overall form guidance for hint text examples and usage.


When to use textarea

  • If you can’t reasonably predict a user’s answer to a prompt and there might be wide variability in users’ answers.
  • When users want to be able to paste in a response.
  • When using another type of input will make answering more difficult.

When to consider something else

  • When a short, single line of text is expected and sufficient.
  • When users are choosing from a specific set of options.

How to use

  • Only show error validation messages or stylings after a user has interacted with a particular field.


  • Max length variation. The Max length variation adds placeholder text inside the textarea. Once the user starts typing this placeholder text disappears. Once the user has entered the same number of characters as the max length, text appears below the field in the following format: (Max. NN characters). At that point no additional text can be entered into the textarea. If the user removes one or more characters and thus goes below the max limit the text beneath the field is removed.

Code usage

Attributes and Properties

Property Attribute Type Default Description
enableAnalytics enable-analytics boolean false Emit component-library-analytics events on the blur event.
error error string The error message to render.
hint hint string Optional hint text.
label label string The label for the textarea.
maxlength maxlength number The maximum number of characters allowed in the input. Negative and zero values will be ignored.
name name string The name for the input.
placeholder placeholder string The placeholder string.
required required boolean false Set the input to required and render the (Required) text.
value value string The value of the textarea


Name Description
component-library-analytics The event used to track usage of the component. This is emitted when the textarea is blurred and `enableAnalytics` is true

Native Events

  • Native onInput and onBlur events are available on this component. They can be used by adding the event handler to your component and it will then listen to the event and respond accordingly when the event fires.

Accessibility considerations

  • Avoid placeholder text. Excluding our max characters variation, avoid using placeholder text. Most browsers’ default rendering of placeholder text does not provide a high enough contrast ratio. Also, placeholder text is no longer visible once a user clicks into the field. Thus users will no longer have that text available when they need to review their entries. People who have cognitive or visual disabilities have additional problems with placeholder text.
  • When using placeholder text, provide screen reader accessible text. When using the placeholder prop, which is used automatically by the Max length variation, additional work is required to make the component accessible. Screen readers such as JAWS and NVDA don’t read placeholder text. Placeholder text is a visual addition only. Thus when using placeholder text to provide important information visually you must also convey this information to screen reader users as well. To do this this add screen read only text within a <span> using the .sr-only CSS class and place the span and text where you would like it to be read out, typically after the field label.
Edit this page in GitHub (Permissions required)
Last updated: Nov 04, 2022