All the basic form elements for Twilio Paste

yarn add @twilio-paste/form — or — yarn add @twilio-paste/core


A textarea allows users to enter text on multiple lines.

About Textarea#

Use a textarea when you want to allow a user to enter text on multiple lines. A textarea allows for any text to be entered and can't be restricted as other inputs can.


  • Include a visible label on all form fields.
  • Each label must use the htmlFor prop that equals the id of the associated textarea.
  • Don't use placeholder text as a replacement for labels. It can be used to provide an example to users, but will disappear from the field when a user enters text. It's also not broadly supported by assistive technologies and won't display in older browsers.
  • Use one of 3 ways to label a form field:
    • Visible label with FormLabel (preferred)
    • Visible label that's associated to the textarea with aria-labelledby
    • Label directly using aria-label
  • Provide clear identification of required fields in the label or at the start of a form. If you use the required field indicator, include the form key at the start of the form.
    • Use the required prop to programatically indicate they are required to browsers.
  • Include inline error text with the error icon on any field that errors to make it visually clear that the field changed.
  • If the textarea has associated help text or error text, include the aria-describedby prop on the textarea. This should match the id of the help or error text.



The textarea should include the base textarea, along with supporting elements to compose a textarea field that gives the user the context they need to successfully fill it out:

  • Label — A label should be included for every form field and provide a short title for its associated textarea.
  • Required field indicator — In a form where there are fewer or as many required fields as optional, use a required indicator to show users which fields are required to be filled out.
  • Help text — Text that's placed below the field to help users prevent an error and describe what makes the form field successful

Hot accessibility tip

Make sure to connect the FormLabel to the FormTextArea. This is done with the htmlFor prop on the label, and the id prop on the textarea. Those two need to match.

If the textarea has any associated help text, the textarea should also use the aria-describedby prop that equals the id of the help text. This ensures screen readers know the help text ties directly to the textarea.

Please enter at least 120 characters

Textarea with add-ons (prefix/suffix text or icons)#

  • Prefix/suffix text — Text that can be used as a prefix and/or suffix to the value that is entered. Use prefix/suffix to help users format text.
  • Icon — Icons can be placed in the same area as the prefix and suffix text. Icons should trigger an action (e.g., clearing a field).
Please enter text for the copy area


Textarea with inline error#

Change a form field to its error state and add an inline error if the value entered doesn't pass validation requirements.

An inline error is placed below the field to inform a user of any errors in their value. If help text exists, the error text should replace and repeat the help text.

Please enter a description

Disabled textarea#

Use a disabled form field to show users that they can't interact with the field.

Read-only textarea#

Use a read-only form field when a field's value can't be changed, but users should be able to read or apply focus on the field. For example, use a read-only form field if a user needs to copy the value.

Composition notes#

A textarea field must have at least a label and a textarea.

Positioning form fields#

Stack form fields vertically with $space-80 spacing between each field.

Avoid placing multiple form fields on the same horizontal row to help make it easier to scan a page vertically. Use the Grid component if you need to place form fields horizontally.

Labels and help text#

Labels should clearly describe the value being requested. They should be concise and descriptive, not instructional. To do this:

  • Use help text to provide instruction if needed. For example, don't use "Enter the registration code on the back of your SIM card below" as label text. Instead, use "SIM registration code" as a label and "Find the registration code on the back of your SIM card" as help text.
  • Avoid articles ("a", "the") and punctuation. For example, use "SIM registration code" rather than "The SIM registration code".

To support internationalization, avoid starting a sentence with the label and using the field to finish it since sentence structures vary across languages. For example, use "Call log expiration date" or "How long should logs be stored?". Don't use "Remove logs after:".

Give users enough information in help text to prevent textarea and formatting errors. Keep it concise and scoped to information that will help with validation. For example, use help text if a password field has specific requirements that a user should know prior to filling it out.

Required field indicator#

Ask for information only when needed. Consider removing the field otherwise.

Use required indicators to show users which fields they must fill out.


Validate form fields on form submission.

Validating a form field when the user leaves the current field (on blur) can be helpful to check for syntax errors. However, this can be frustrating to users who tab through controls to navigate a page, and to screen reader users, who might not be able to detect that an error occurred on blur.

Don't prevent form submission by disabling the submit button. An error message can give more information than a disabled button can to help users figure out which fields are invalid.


Use inline error text to explain how to fix an error.

Ideally, help text should have enough information to help users prevent errors. If help text exists and you need to show an error, the error text should replace and repeat the help text until the error has been resolved.

Error text should:

  • Be actionable. Explain how to fix an error and if reasonable, why it happened so that it might also be prevented in the future.
  • Be concise and simple, maybe even more than normal. Avoid jargon. Try to keep error text to 2 sentences or fewer.
  • Use the passive voice for textarea errors to avoid placing blame on the user. For example, "A friendly name is required."
  • Use the active voice for system errors. For example, "Our systems are currently down. Please contact our support team."

Optional compositional elements#

  • Prefix/suffix — Use a prefix or suffix to help users format their textarea and to provide more context about the value a user is entering. For example, you could prefix or suffix a field with a currency symbol, or use suffix to append a character counter. Make sure to consider internationalization when using prefixes or suffixes since formatting may differ across languages. For example, currency symbols are placed on the left in American English, while they're placed on the right in French. Don't use prefix/suffix text as a replacement for a label.
  • Icon — Use an icon if you need to give the user additional controls for the field. For example, use an icon to clear a field on click, removing the need for users to manually delete their entered value. Place icon buttons that trigger an action on the right side of the field. If you need 2 actions on a field (e.g., popover trigger and clear field), place the icon button that affects the field value on the right, and the other icon on the left.
  • Placeholder — Use a placeholder when you want to give an example of the type of data a user should enter, mainly to help with recall. For example, when asking for links to social media profiles, you could give examples of a few social media sites. Placeholders should be used in addition to the label and not as a replacement since they'll disappear when a user begins entering their own value. If you need to show supporting instructions, use help text instead.

When to use an textarea#

Use a textarea when users are expected to enter text that exceeds a single line, usually longer than a sentence.


Use a textarea to encourage longer text entry.


Don't use a textarea when text entry is expected to be short since it could confuse users. Use an input instead.

Limit to 120 characters

If you limit the length of text entry, show a character counter and explain to users in help text why their entry is restricted.


Don't have a character limit if you can't explain to the user why their text entry is restricted.

Please enter: Paste is open source and contributions are welcome.

Use help text to help users prevent errors and fill out a form field correctly.


Don't use placeholder text for validation instructions.

This is a required field. Please enter some text.

Keep help text and error text concise and simple. If you need to use more than 2 sentences to explain a field, link out to supporting docs or trigger a popover instead.

This field is needed to submit your document. If you don't enter any text, your submission will fail. Please enter some text into the field. This will make the field valid.

Don't use more than 2 sentences in help text or error text.


Include a visible label on every form field.

Footer Text

Don't use prefix/suffix text as a replacement for a label.


Use a disabled form field to show users that they can't interact with the field, but that it could potentially be enabled through another UI element.


Don't use a disabled form field to show information that can't be edited. Instead, use a read-only form field or consider another way of showing static information.


PropertyDefault tokenModifiable?
Label text
  • $font-size-30
  • Default: $color-text, $font-weight-semibold
  • Disabled: $color-text-weaker, $font-weight-semibold
Required field indicator
  • 4px size (0.25rem)
  • Background: $color-background-required
Box Shadow
  • Default: $shadow-border
  • Hover: $shadow-border-primary-dark
  • Disabled: $shadow-border-light
  • Error: $shadow-border-error
  • Error hover: $shadow-border-error-dark
  • Default: $color-background-body
  • Disabled, Readonly: $color-background
  • Background: $color-background
  • Border: $color-border-lighter
Prefix/suffix text
  • Default: $color-text
  • Disabled: $color-text-weak
Value text
  • $font-size-30
  • Default, Readonly: $color-text
  • Disabled: $color-text-weaker
No, but it can take any children
Placeholder text$color-text-weak, italicNo
Help text$color-text-weak, $font-size-30No
Inline error
  • Text: $color-text-error, $font-size-30
  • Icon: IconError, $color-text-error, $icon-size-20
  • Label:
    • Bottom: $space-10
    • Between label and required indicator: $space-20
  • Textarea:
    • Left padding: $space-40
    • Top, right, bottom padding: $space-30
  • Prefix/suffix padding: $space-30
  • Help text:
    • Top: $space-20
  • Inline error:
    • Spacing between icon and text: $space-20
    • Top: $space-20

Usage Guide#



yarn add @twilio-paste/form - or - yarn add @twilio-paste/core


import {FormTextArea, FormLabel, FormHelpText} from '@twilio-paste/form';
const Component = () => (
<FormLabel htmlFor="foo" required>
<FormTextArea aria-describedby="foo_text" id="foo" name="foo" placeholder="foo" required />
<FormHelpText id="foo_text">Please enter some text</FormHelpText>

FormTextArea Props#

All the valid HTML attributes for textarea are supported including the following props:

idstringSets the id of the textarea. Should match the htmlFor of FormLabel. Required.null
namestringSets the name of the textarea. Required.null
placeholder?stringSets the placeholder of the textarea.null
disabled?booleanDisables the textarea.false
readOnly?booleanSets the textarea to readonly.false
required?booleanSets the textarea as required.false
hasError?booleanSets the textarea to an error state.false
onChange?(event: React.MouseEvent<HTMLElement>)null
onFocus?(event: React.MouseEvent<HTMLElement>)null
onBlur?(event: React.MouseEvent<HTMLElement>)null
variant?'default', 'inverse''default'

FormLabel Props#

All the valid HTML attributes for label are supported including the following props:

htmlForstringSets the for of the label. Should match the id of FormTextArea. Required.null
disabled?booleanShows the textarea is disabled.false
required?booleanShows the textarea is required.false
marginBottom?'space0', 'space10''space10'
variant ?'default', 'inverse''default'

FormHelpText Props#

All the valid HTML attributes (role, aria-*, type, and so on) including the following props:

marginTop?'space0', 'space20''space20'
variant?'default', 'error', 'error_inverse', 'inverse'Changes the state.'default'


If you need support, please open a new issue in our GitHub repository. Please try to provide as much detail as possible in your issue.


The Paste design system is open source and contributions are welcome. Check out the project on GitHub to learn more about contributing.

Copyright © 2020 Twilio, Inc.