Textarea

Textareas collect longer notes, descriptions, and collaborative product content.

Overview and decision boundary

Use Textarea for longer notes, descriptions, comments, and collaborative content.

Do not use Textarea for single-line values like titles or search.

Preview

Add context that helps collaborators understand this item.

import { Field, Textarea } from '@nerio-ui/ui';<Field label="Notes" description="Add context for collaborators."><Textarea placeholder="Add launch context" /></Field>

Installation and imports

Install the editable registry source, or use the matching package entrypoint when the product keeps Nerio as a workspace dependency.

pnpm dlx nerio add textareaimport { Field, Textarea } from '@nerio-ui/ui';

Usage

import { Field, Textarea } from '@nerio-ui/ui';<Field label="Notes" description="Add context for collaborators."><Textarea placeholder="Add launch context" /></Field>

Variants

VariantPurpose
defaultDefault variant using semantic Nerio tokens.
invalidInvalid is part of the public component contract.
disabledDisabled is part of the public component contract.
read-onlyRead Only is part of the public component contract.

Anatomy

SlotPurpose
rootNative textarea with tokenized border, radius, padding, and focus.

States

StatePurpose
FocusVisible focus treatment remains consistent with Input.
DisabledKeeps content visible while preventing edits.
Read-onlyStays focusable and selectable while using the shared read-only control surface.
RequiredUse native required attributes for mandatory long-form values.
InvalidPair with Field and FormMessage.

Motion

  • State changes should use shared motion tokens and preserve reduced-motion behavior.

Accessibility

  • Use with Label or Field so the control has an accessible name.
  • Supports native textarea attributes including required, disabled, readOnly, aria-describedby, and rows.
  • Invalid state maps to aria-invalid and a truthful data-invalid hook, including when aria-invalid is supplied directly.
  • Read-only stays focusable and selectable while exposing the same shared form-control boundary as Input.
  • Keep resize behavior available unless a product workflow requires a fixed height.

API

PropPurpose
classNameExtends the component root while preserving Nerio tokenized defaults.

Implementation contract

ContractValue
Registry itemtextarea installs 6 source files into the configured components directory.
Base UINo interactive primitive required.
Registry dependenciesNone.
Package dependenciesclsx, react, tailwind-merge, tailwindcss

Styling contract

ContractValue
AuthoringComplete, statically detectable Tailwind CSS v4 recipes own component visuals.
ValuesSemantic and component --n-* variables remain the canonical customization layer.
OverridesCustomizable slots merge consumer className values with tailwindCn so conflicting utilities resolve deterministically.
Residual CSSOnly shared keyframes and scoped no-Preflight compatibility rules remain; there is no parallel visual selector layer.

Design notes

  • Use Textarea for longer notes, descriptions, comments, and collaborative content.

Do / do not

Do

Use for content that benefits from multiple lines.

Do not

Do not use Textarea for single-line values like titles or search.

Tokens

These are the primary customization points. Override semantic or component tokens instead of changing component source.

TokenPurpose
--n-input-height-mdPublic customization point for this component contract.
--n-textarea-min-heightPublic customization point for this component contract.
--n-input-radiusPublic customization point for this component contract.
--n-input-backgroundPublic customization point for this component contract.
--n-input-borderPublic customization point for this component contract.
--n-input-border-hoverPublic customization point for this component contract.
--n-input-border-focusPublic customization point for this component contract.
--n-input-border-dangerPublic customization point for this component contract.
--n-input-placeholderPublic customization point for this component contract.
--n-input-foregroundPublic customization point for this component contract.
--n-input-disabled-backgroundPublic customization point for this component contract.
--n-input-disabled-foregroundPublic customization point for this component contract.
--n-input-readonly-backgroundPublic customization point for this component contract.
--n-input-readonly-borderPublic customization point for this component contract.
--n-focus-ringPublic customization point for this component contract.