Browse Components

Components

Textarea

Text areas allow for the collection of input longer than a single line.

DesignUsageAccessibilityUpdates

Purpose

Collect longer text

Use textareas for responses that may need more than one line.

Give enough writing space

Rows and resize options help the field fit the expected response length.

Reuse form feedback

Textarea uses the same validation and helper patterns as other form fields.

Anatomy

1

Label

2

Value

3

Hint text

4

Input container

5

Character count

Configuration

Hint text

Use hint text to clarify expectations for the response.

Default. Use when the label alone is enough.

Placeholder

Show a placeholder to suggest the kind of content the user can enter.

Empty textarea with no inline helper.

Character count

Set maxlength to show the character count below the textarea.

Default. No count appears when maxlength is not set.

Rows

Use the rows attribute to set the visible height of the textarea.

Compact textarea suited to short responses.

Resize

Control whether the user can resize the textarea.

Drag the bottom-right corner to resize vertically.

Read-only

Display a value that the user can read and copy but not edit.

Default editable textarea.

Disabled

Disable the textarea to prevent it from being edited or focused.

Default interactive state.

Required

Mark the textarea as required when the form cannot be submitted without a value.

Default. The textarea can be left blank.

Length validation

Use minlength and maxlength to validate the allowed response length.

Use minlength when the response needs enough detail.

Validation feedback

Show error styling and a feedback message when the input is invalid.

No feedback shown.

Structure

Design tokens used

Each row is a colour, spacing, or size value the component uses, and the right-most column tells you where in the component you'll see it.

CategoryTokenValueWhere it's usedPaddingsgds-form-padding-xSpace between the left and right edges of the component and its contentsgds-form-padding-ySpace between the top and bottom edges of the component and its contentSizesgds-dimension-136Minimum height of the textarea form control groupsgds-icon-size-mdSize of the interactive icon inside the textarea

Usage

When to use

  • Use textarea when users need to enter a longer freeform response.
  • Use it for content that may span several sentences or needs room to explain context.

When not to use

  • Do not use textarea for short structured values that belong in a smaller field.
  • Do not leave the prompt so vague that users do not know what level of detail to provide.

Best practices

Use textarea for open-ended responses

Use textarea when users may write more than one line. Feedback, descriptions, or notes.

Do not use textarea for single-line values

For a one-line value like a name or reference number, use a text input. Textarea implies a longer response.

Use resize="auto" when responses can vary widely

Set resize to auto so the textarea grows with the content rather than trapping users in a tiny scroll area.

Do not lock the height when responses might be long

Avoid resize="none" for open-ended questions. Users get stuck scrolling once they exceed the visible rows.

Accessibility considerations

Built-in accessibility

  • Textareas render native textarea controls and connect labels, hint text, and feedback to the control.
  • The component supports disabled, readonly, required, invalid, and feedback states.

Labels and content

  • Use a visible label that tells users what to enter.
  • Use hint text for character limits or formatting expectations.

Focus and interaction

  • Focus should move to the textarea in form order.
  • Keep validation feedback close to the textarea.

Keyboard interaction

KeyInteractionTabMoves focus from the textarea to the next focusable element.Shift+TabMoves focus to the previous interactive element.Text keysEnters or edits text in the textarea.EnterAdds a new line in the textarea.

Updates

DateVersionDescription02 Mar 2026v3.12.0NoValidate prop support in #549.

Roadmap

Planned itemStatusTargetFuture enhancements for textareaPlannedTBD

Feedback

Have suggestions or feedback?

Share them with us on Slack → #ask-sgds-v3

Bug Reports

Found a bug or issue?

Report it on GitHub Issues → sgds/components/textarea

Singapore Government Design System

The Singapore Government Design System was developed to empower teams in creating fast, accessible and mobile-friendly digital services.

Past VersionsSGDS v1SGDS v2