Skip to main content
InputLevel 1

Text Area

多行输入框

WebMobileDesktopDifficulty: Easy

A text field that wraps onto multiple lines, for content that runs longer than a sentence.

01

Live Demo

Actually clickable
Line breaks are kept0 / 300
The box grows as you type (up to 320px), with a live character count bottom-right.

What you just saw:Comment boxes, message-board composers, the body editor in a notes app, the issue description field on GitHub — all Text Areas.

02

What it actually is

The only real difference between a Text Area and a Text Field is that its height can change, so it can hold a paragraph. The key design point: never ship a short default height — a box that is two lines tall tells the user two lines is all the room they get.

text areatextareamulti-line inputlong text inputcomment box
03

Anatomy · What it's made of

  1. Container容器

    Resizable height, min-height 96px

  2. Placeholder占位文字

    Use a realistic example sentence

  3. Resize Handle缩放手柄

    Draggable from the bottom-right corner on the web

  4. Counter字数统计

    Shows "128 / 500" in the bottom-right corner

04

When to Use

When it fits, and when it doesn't
Text Area usage recommendations
SituationUse it?
The input is paragraph-length (a comment, a note, a description)Yes
You cannot predict how much the user wants to writeYes
The content needs a formatted preview (Markdown)Yes
The answer is a single character (e.g. a verification code)No

A 2-row default discourages people who write long — start at 4–6 rows and support auto-grow.

On mobile it fights the on-screen keyboard, so leave room for scrolling.

05

Similar Patterns

Don't mix these up
06

How to tell AI

Three levels of prompt

Add the component name and specifics

Add a comment box: 4 rows tall at minimum, grows automatically with the content, a "0 / 300" character counter in the bottom-right corner, and action buttons revealed on focus.

07

Don't just say this to AI

Bad → Better

Don't say this to AI

Add a slightly bigger text field.

Say this instead

Add a multi-line Text Area: min-height of 4 rows + auto-grow (capped at 320px), a "0 / 300" character counter in the bottom-right corner that changes color as you approach the limit.

08

Share this card

Social-ready

Turn this pattern into a 3:4 or 1:1 knowledge card and export it as PNG right in the browser. No backend needed.