# TextField

> Creates a new textfield.

## Definition

* **Type:** Constructor
* **Namespace:** [UnityEngine.UIElements](/engine/6000.0/script-reference/unityengine/uielements.md)
* **Assembly:** UnityEngine.UIElementsModule

## TextField()

Creates a new textfield.

```csharp
public TextField()
```

## TextField(int, bool, bool, char)

Creates a new textfield.

```csharp
public TextField(int maxLength, bool multiline, bool isPasswordField, char maskChar)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The maximum number of characters this textfield can hold. If -1, there is no limit.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Set this to true to allow multiple lines in the textfield and false if otherwise.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Set this to true to mask the characters and false if otherwise.**** (\[char]\(https\://learn.microsoft.com/dotnet/api/system.char)): The character used for masking in a password field.

## TextField(string)

Creates a new textfield.

```csharp
public TextField(string label)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)):&#x20;

## TextField(string, int, bool, bool, char)

Creates a new textfield.

```csharp
public TextField(string label, int maxLength, bool multiline, bool isPasswordField, char maskChar)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): **** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The maximum number of characters this textfield can hold. If 0, there is no limit.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Set this to true to allow multiple lines in the textfield and false if otherwise.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): **** (\[char]\(https\://learn.microsoft.com/dotnet/api/system.char)): The character used for masking in a password field.
