Clinia UI

Textarea

Several lines of free text, such as a note or a description.

shadcn docs →

When to use

  • Free text that can run past one line: a note, a description, a message to a clinician.

When not to use

  • One line, such as a name or a URL: use Input.
  • Text with a button or a hint attached inside the border, such as a prompt box: use Input Group with InputGroupTextarea.

Install

npx shadcn@latest add @clinia/textarea

Marketing (Sera)

Clinia rules

  • The border is the input token, like Input, so the field edge clears 3:1 on the page and on cards.
  • The box grows with its content (field-sizing-content) from a 64px minimum, and it can't be resized by hand. Set a min-h-* class to show how much text you expect: rows has no effect under field-sizing-content.
  • Text is 16px on small screens and 14px from md up, so iOS doesn't zoom in on focus.

Do and don't

Do use it for text that can run past one line.
Don't use it for a one-line value: use Input.

States: product (Luma)

placeholder
filled
focus
invalid
disabled

Focus cells apply the component's focus-visible classes statically. Toggle the site theme to review both themes.

States: marketing (Sera)

placeholder
filled
focus
invalid
disabled

Focus cells apply the component's focus-visible classes statically. Toggle the site theme to review both themes.

Accessibility

Built in

  • Focus-visible shows a solid Trust ring (border-ring ring-3 ring-ring/30); aria-invalid swaps it to a destructive ring.

Your responsibility

  • Give it a visible label: FieldLabel inside Field, or Label with htmlFor.
  • If there is a length limit, say so in a FieldDescription and point aria-describedby at it. Don't rely on maxLength alone: it cuts text off silently.
  • On error, set aria-invalid and point aria-describedby at the FieldError.

How to test

  1. Click the label: focus moves to the textarea.
  2. Press Tab into it: the Trust ring appears. Type several lines: the box grows and nothing is clipped.
  3. Press Enter: it adds a new line and doesn't submit the form.
  4. With a screen reader, it's announced as its label, then as an edit text with multiple lines.

API

Every prop comes from the native textarea element.