BetaPublic beta — Read the release notes
Documentation

Textarea

Native textarea primitive with validation states and optional auto-resizing.

Package
@solidiom/textarea
Version
0.6.0
Status
stable

Preview

Native textarea primitive with validation states and optional auto-resizing.

Usage

Import and render Root.

import * as Textarea from "@solidiom/textarea"

;<Textarea.Root defaultValue="Textarea content" aria-label="Message" />

Installation

Install the package with pnpm add @solidiom/textarea. The package requires compatible solid-js and @solidjs/web peer dependencies.

Parts

Textarea exposes 1 part:

  • Root — data-part="root".

Styling

Textarea carries data-scope="textarea" and data-part="root" for CSS/recipe targeting. State attributes such as data-disabled, data-invalid, data-readonly, and data-required are exposed when the corresponding native/component state or incoming ARIA state is present.

Keyboard & behavior

Root is a native, focusable <textarea> and retains the browser’s normal keyboard, selection, form, and focus behavior. Use value for controlled state, defaultValue for an uncontrolled mount-time value, and onValueChange for input notifications. autoResize measures on the client after settlement and can be limited with maxRows.

SSR and hydration

Textarea renders its native value and semantic attributes during server rendering. defaultValue is an uncontrolled mount-time snapshot and is not reapplied when its prop changes. Client-only auto-resize runs after hydration and may change layout. Incoming aria-disabled, aria-required, and aria-readonly describe state but do not by themselves set the native disabled, required, or readonly properties; pass the component/native state props when native behavior is required.