# Input

## Create

```lua
local InputExapmle = PluginComponents.Component.Input.New()
.SetParent(Container)
.SetLabel("Npc login:")
.SetPlaceholder("Write login")
.Change:Connect(function(val, prevval)
    print(val, prevval)
end)

```

## Event

### .Change:Connect(val, prevVal)

Called each time a field value is changed. The VAL parameter returns the current value of the field. The prevVal argument returns the past value.

## Methods

### .Get

The value of the field is returned

### .Set(val)

Changes the value of the field

### .SetLabel(val)

Changes the label near the field. If there is one

### .SetPlaceholder(val)

Changes the placeholder of an empty field

### .ResetText()

Resets the value to an empty string

### .SetValidate()

Changes the way the field is validated. The default method is specified:

PluginComponents.Validate.Any()

`.SetValidate(PluginComponents.Validate.Any())`

Подробнее:

{% content-ref url="../extra-functions/validate" %}
[validate](https://destplay.gitbook.io/plugin-components/extra-functions/validate)
{% endcontent-ref %}

### **Inherited from** [**BaseComponent**](https://destplay.gitbook.io/plugin-components/get-started/basecomponent)

{% content-ref url="../get-started/basecomponent" %}
[basecomponent](https://destplay.gitbook.io/plugin-components/get-started/basecomponent)
{% endcontent-ref %}

## Properties
