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.

directControlledboolean

Whether the input is directly controlled or not. If true, the value prop is used.

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.

maxstring

The maximum value to accept for the input if type is number.

minstring

The minimum value to accept for the input if type is number.

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.

onKeyDownfunction

On key down function handler.

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.

stepstring

The step value to accept for the input if type is number.

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.

widthstring

The width of the input. Can be "full" or "auto".

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"
    />
);