A multi type input component that supports standard text, email, tel.

Parameters:
NameTypeDescription
propsobject

Component props.

Properties
NameTypeDescription
borderStylestring

The border style, one of default, error, or correct.

clearableboolean

If input is clearable.

clearableButtonAttributesobject

Custom attributes for the clearable button.

controlledboolean

Whether the input is controlled or not.

customAttributesobject

Custom attributes for the component.

customClassesstring | Array | object

Custom classes for the component.

disabledboolean

If input is disabled.

helpTextAttributesobject

Custom attribute for the help text.

helpTextPositionstring

The position of the help text.

iconAttributesstring

Custom attributes for the icon.

idstring

Optional id. Auto generated if not passed.

labelAttributesobject

Any custom attributes for the label.

namestring

The name attribute for the input.

onBlurfunction

On blur function handler.

onChangefunction

On change function handler.

onClearfunction

On clear function handler. When clearable true, this function is called when it occurs.

onFocusfunction

On focus function handler.

placeholderstring

The optional placeholder attribute for the input.

requiredboolean

Whether the field is required or not.

requiredLabelobject

Required label properties.

sizestring

The input size: regular (size-r), large (size-l), or extra large (size-xl).

spacingstring | number | Array | object

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

textSecuritystring

The text security of the input, one of circle, disc, square, or none.

themestring

The theme of the input.

typestring

The input type.

valuestring

The input value.

wrapperAttributesobject

Custom attributes for the wrapper element.

wrapperClassesstring | Array | object

Custom classes for the wrapper element.

wrapperTagNameobject

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

refobject | null

Ref to the component.

Since
  • 1.1.15
Returns:

The input component.

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

return (
    <Input
        onChange={ () => {} }
        placeholder="I am a placeholder"
    />
);