Trên trang này

Trang này chưa có bản tiếng Việt, nội dung bên dưới là bản tiếng Anh. Xem trang tiếng Anh

Ô nhập nhiều dòng

When to use Textarea, how to label it and the tokens it uses.

Draft. Ported from the shadcn-vue Textarea and restyled with Beehexa tokens on 12 November 2026. Not yet approved. It uses the text-field focus of decision D29.

Textarea is a text field for more than one line: a note on a packing slip, a reason for a refund, a reply to a customer. It starts about three lines tall and grows with its text.

When to use

  • For free text that may run past one line: notes, reasons, descriptions, messages.

When not to use

  • For a short value such as a name or an email address. Use Input.
  • For code or JSON. Use a code editor, which keeps spacing and shows line numbers.
  • For a value people can read but not change. Show it as text.

Label, help text and error

The same as Input: the label above, help text and errors under the box, linked with aria-describedby. When there is a character limit, say it in the help text and show how many characters are left. Don’t let the browser cut text silently.

States

The same edges and fills as Input: color.border.bold at rest; color.border.focus plus its 2 px inset ring on focus; color.border.danger with aria-invalid="true"; the disabled colours when disabled.

Tokens

Part Tokens
Corners radius.control
Padding space.control.x at the sides, space.100 top and bottom
Text font.body.default; placeholder color.text.subtlest
Edge border.width.default, color.border.bold
Height At least about three lines (80 px); grows with the text (field-sizing: content)
  • Input: one line.
  • Input group: a text area with a count and a send button in one box.
  • Field: label, help text and error around it.