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.
| Prop | Type |
|---|---|
error | boolean |
width | FluidWidth |
TextareaField
Help users provide detailed information using the textarea component.
| Prop | Type |
|---|---|
labelSize | "s" | "m" | "l" | "xl" |
labelIsPageHeading | boolean |
width | FluidWidth |
labelThe label used by the textarea component. | ReactNode |
hintCan be used to add a hint to the textarea component. | ReactNode |
errorMessageCan 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 | ReactNode |