ComponentsEnterpriseTextarea

Textarea

Textarea captures multi-line free-form input with labeling, guidance, validation, and counting.

3 variants3 sizesValidationCharacter countAuto-resize

Overview

Use Textarea for multi-line responses where people need space to explain, summarize, comment, or provide structured free-form context.

Change rationale

Live preview

Type to see the live character count update.

This rationale is included in the audit record.0 / 500
ChangeRationale.tsx
tsx
import { Textarea } from 'omverse-ui'
 
<Textarea
label="Change rationale"
placeholder="Explain why this change is required…"
helperText="This rationale is included in the audit record."
maxLength={500}
showCount
required
/>

Anatomy

Textarea combines a persistent label, multi-line control, entered content, supporting feedback, and optional count or resize affordance.

Coordinate the migration with security and support.◢
Included in the audit record.52 / 500
12345
  1. 1
    Label

    Names the expected response and required state.

  2. 2
    Input area

    Provides a visible multi-line entry boundary.

  3. 3
    Content

    Wraps naturally and scrolls or expands as configured.

  4. 4
    Supporting message

    Provides guidance, error, or success feedback.

  5. 5
    Count and resize

    Shows length constraints and optional manual resizing.

When to use

Use Textarea when a response may contain multiple sentences, paragraphs, or line breaks.

Recommended

  • Collect rationale or notes

    Give enough room for decisions, review comments, and operational context.

  • Accept variable-length responses

    Use counting to make meaningful limits visible.

  • Preserve line breaks

    Choose Textarea when formatting across lines helps comprehension.

When not to use

Use a more constrained control when the expected value is short, enumerable, or structurally complex.

Avoid

  • Do not collect short identifiers

    Use Input for names, IDs, emails, and single-line values.

  • Do not hide governed choices

    Use Select or Combobox for constrained values.

  • Do not build a rich editor

    Use a dedicated editor for formatting, mentions, or attachments.

Variants

Treatment, size, resizing, and content-driven height adapt the control to different form contexts.

Outlined

Default visible field boundary.

Filled

Tonal surface for grouped forms.

Underlined

Compact treatment for restrained layouts.

Resize behavior

None, vertical, both, or automatic height.

States

Textarea communicates availability, focus, validation, and content constraints without replacing application validation.

StateTriggerVisual responseInteraction
EmptyNo value enteredPlaceholder may provide an exampleReady for entry
FocusedControl receives focusPrimary border and ringText entry active
ErrorValue fails validationError border and messageEditable correction
SuccessValue is confirmedSuccess border and messageRemains editable
DisabledField unavailableReduced emphasisNot focusable
Read-onlyValue cannot changeTonal surfaceContent remains selectable

Behavior

Textarea follows native text-entry behavior and adds design-system guidance, validation, counting, and height management.

Text wrapping

Long text wraps without horizontal scrolling by default.

Character count

Count reflects controlled or uncontrolled values.

Auto-resize

Height follows scroll height while manual resize is disabled.

Form integration

Native name, required, disabled, and maxLength remain available.

Accessibility

Textarea preserves native semantics and programmatically connects labels, messages, counts, and invalid state.

KeyAction
TabMoves focus into or away from the field.
EnterCreates a new line.
ShiftTabMoves focus to the previous control.
  • Provide a persistent visible label for every textarea.
  • Use helper text for instructions that remain relevant during entry.
  • Expose invalid state and connect error text with aria-describedby.
  • Do not use placeholder text as the only label.
  • Set a meaningful maxLength before showing a limit count.
  • Keep resize or auto-resize behavior usable at high zoom.

Content guidelines

Labels and guidance should make the expected depth, purpose, and constraints of the response clear.

Name the response

Use a concise noun phrase.

ExampleChange rationale

Explain purpose

Say how the response will be used.

ExampleIncluded in the audit record.

Demonstrate format

Use placeholder examples sparingly.

ExampleSummarize the customer impact…

Write corrective errors

Explain how to resolve the problem.

ExampleAdd at least 20 characters.

Examples

Controlled value and auto-resize support review workflows while validation remains application-owned.

Controlled response

Live preview
Address the unresolved policy exception.
ReviewResponse.tsx
tsx
<Textarea
label="Review response"
value={response}
onChange={(event) => setResponse(event.target.value)}
errorText={error}
autoResize
/>

Props / API

Textarea extends native textarea attributes except the conflicting size attribute.

Props

PropTypeDefaultDescription
labelReactNodeundefinedVisible field label.
helperTextReactNodeundefinedSupporting instruction below the field.
errorTextReactNodeundefinedError message and invalid styling.
successTextReactNodeundefinedSuccess message and valid styling.
showCountbooleanfalseShows current and maximum character counts.
autoResizebooleanfalseExpands height to fit content.
variant'outlined' | 'filled' | 'underlined''outlined'Controls field treatment.
size'sm' | 'md' | 'lg''md'Controls minimum height, spacing, and type.
resize'none' | 'vertical' | 'both''vertical'Controls manual resize direction.
containerClassNamestringundefinedClass name for the field wrapper.