structyl

Textarea API

View component

The full prop reference for the Textarea component. A styled multi-line text input.

Import

tsx
import { Textarea } from '@structyl/styled';

Props

Textarea

A controlled/uncontrolled textarea form control with semantic HTML and optional styling

PropTypeDefault
value#string

Controlled value of the textarea

defaultValue#string

Initial value for uncontrolled textarea

onChange#(e: React.ChangeEvent<HTMLTextAreaElement>) => void

Callback fired when textarea value changes

disabled#boolean

Disables the textarea and prevents user input

placeholder#string

Placeholder text shown when textarea is empty

rows#number

Visible height of textarea in number of lines

cols#number

Visible width of textarea in characters

maxLength#number

Maximum number of characters allowed

minLength#number

Minimum number of characters required

required#boolean

Marks textarea as required in form submission

readOnly#boolean

Makes textarea read-only, preventing user edits

spellCheck#boolean | 'true' | 'false'

Enables spell-checking for the textarea

wrap#'hard' | 'soft' | 'off'

How text wrapping should be handled

aria-invalid#boolean

Marks the textarea as invalid for accessibility

id#string

Unique identifier for the textarea element

className#string

CSS class names to apply to the textarea

ref#React.Ref<HTMLTextAreaElement>

Forward ref to access the underlying textarea DOM element

Source code

If you didn't find what you need here, read the component implementation .

structyl — Accessible React Component Library