Textarea API
View componentThe full prop reference for the Textarea component. A styled multi-line text input.
Import
import { Textarea } from '@structyl/styled';Props
Textarea
A controlled/uncontrolled textarea form control with semantic HTML and optional styling
| Prop | Type | Default |
|---|---|---|
| value# | stringControlled value of the textarea | — |
| defaultValue# | stringInitial value for uncontrolled textarea | — |
| onChange# | (e: React.ChangeEvent<HTMLTextAreaElement>) => voidCallback fired when textarea value changes | — |
| disabled# | booleanDisables the textarea and prevents user input | — |
| placeholder# | stringPlaceholder text shown when textarea is empty | — |
| rows# | numberVisible height of textarea in number of lines | — |
| cols# | numberVisible width of textarea in characters | — |
| maxLength# | numberMaximum number of characters allowed | — |
| minLength# | numberMinimum number of characters required | — |
| required# | booleanMarks textarea as required in form submission | — |
| readOnly# | booleanMakes 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# | booleanMarks the textarea as invalid for accessibility | — |
| id# | stringUnique identifier for the textarea element | — |
| className# | stringCSS 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 .