TextArea
Labelled multi-line input. onChange receives the value string. Set maxLength for a live character count, error for the invalid style and message.
helperText shows a hint under the field while there is no error, and links it to the control with aria-describedby. It sits beside the character count.
0 / 120
Props
labelstringLabel text.
valuestringDefault:''Current value.
onChange(value: string) => voidCalled with the new value.
errorstringError message shown below the control; sets the invalid style.
rowsnumberDefault:4Visible rows.
maxLengthnumberMaximum length; also shows a character count.
resizebooleanDefault:trueAllow vertical resizing.
classNamestringDefault:''Extra classes for the root element.
...restAny other props are passed to the underlying element.
| Prop | Type | Default | Description |
|---|---|---|---|
label | string | – | Label text. |
value | string | '' | Current value. |
onChange | (value: string) => void | – | Called with the new value. |
error | string | – | Error message shown below the control; sets the invalid style. |
rows | number | 4 | Visible rows. |
maxLength | number | – | Maximum length; also shows a character count. |
resize | boolean | true | Allow vertical resizing. |
className | string | '' | Extra classes for the root element. |
...rest | – | Any other props are passed to the underlying element. |