TextArea
The TextArea component lets users enter long form text which spans over multiple lines.
View source code- onChange
ChangeEventHandler<HTMLTextAreaElement>
Handler that is called when the value changes.
- value
string
The current value (controlled).
- className
string
className for the element
- id
string
The id of the TextArea
- isDisabled
boolean
Whether the TextArea is disabled.
Default: false - isInvalid
boolean
Whether the TextArea is invalid.
Default: false - isReadOnly
boolean
Whether the TextArea should be read only.
Default: false - key
Key
- maxLength
number
The maximum number of characters supported by the TextArea.
- name
string
The name of the TextArea, used when submitting an HTML form
- onBlur
FocusEventHandler<HTMLTextAreaElement>
Handler that is called when the element loses focus.
- onFocus
FocusEventHandler<HTMLTextAreaElement>
Handler that is called when the element receives focus.
- onKeyDown
KeyboardEventHandler<HTMLTextAreaElement>
Handler that is called when a key is pressed.
- placeholder
string
Temporary text that occupies the TextArea when it is empty.
- ref
Ref<HTMLButtonElement>
Allows getting a ref to the component instance. Once the component unmounts, React will set `ref.current` to `null` (or call the ref with `null` if you passed a callback ref). @see {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs}
- rows
number
The number of visible text lines for the control.
Default: 3