A textarea component.

Parameters:
NameTypeDescription
propsobject

Component props.

Properties
NameTypeDescription
controlledboolean

Whether the textarea is controlled or not.

customAttributesobject

Custom attributes for the component.

customClassesstring | Array | object

Custom classes for the component.

disabledboolean

If textarea is disabled.

helpTextAttributesobject

Custom attribute for the help text.

helpTextPositionstring

The position of the help text.

idstring

Optional id. Auto generated if not passed.

labelAttributesobject

Custom attributes for the label.

namestring

The name of the textarea.

onBlurfunction

On blur function handler.

onChangefunction

On change function handler.

onFocusfunction

On focus function handler.

placeholderstring

The optional placeholder attribute for the textarea.

spacingstring | number | Array | object

The spacing for the component, as a string, number, array, or object.

themestring

The theme of the textarea.

valuestring

The textarea's initial value.

wrapperAttributesobject

Custom attributes for the wrapper element.

wrapperClassesstring | Array | object

Custom classes for the wrapper element.

wrapperTagNameobject

Tag to use for the textarea wrapper. Defaults to div.

refobject | null

Ref to the component.

Since
  • 1.1.18
Returns:

The Textarea component.

Type: 
JSX.Element
Example
import Textarea from '@gravityforms/components/react/admin/elements/Textarea';

return (
    <Textarea
        id="textarea-id"
        placeholder="Textarea placeholder"
        onChange={ () => {} }
    />
);