Skip to main content
Components

Textarea

Help users provide detailed information using the textarea component.

Read the Design System guidance for textarea

Import

import { Textarea, TextareaField } from 'govuk-react/textarea';

Examples

Default

Code
<TextareaField
  id="more-detail"
  name="more-detail"
  label="Can you provide more detail?"
/>

Textarea with hint text

Code
<TextareaField
  id="more-detail"
  name="more-detail"
  label="Can you provide more detail?"
  hint="Do not include personal or financial information, like your National Insurance number or credit card details"
/>

Textarea with hint text error

Code
<TextareaField
  id="more-detail"
  name="more-detail"
  label="Can you provide more detail?"
  hint="Do not include personal or financial information, like your National Insurance number or credit card details"
  errorMessage="Enter more detail"
/>

API reference

Textarea

Help users provide detailed information using the textarea component.

PropType
errorboolean
widthFluidWidth

TextareaField

Help users provide detailed information using the textarea component.

PropType
labelSize"s" | "m" | "l" | "xl"
labelIsPageHeadingboolean
widthFluidWidth
label

The label used by the textarea component.

ReactNode
hint

Can be used to add a hint to the textarea component.

ReactNode
errorMessage

Can be used to add an error message to the textarea component. The error message component will not display if you use a falsy value for errorMessage, for example false or null.

ReactNode