# DropdownField

> Construct an empty DropdownField.

## Definition

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

## DropdownField()

Construct an empty DropdownField.

```csharp
public DropdownField()
```

## DropdownField(string)

Construct a DropdownField with a Label in front.

```csharp
public DropdownField(string label)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The label to display in front of the field.

## DropdownField(List\<string>, string, Func\<string, string>, Func\<string, string>)

Construct a DropdownField.

```csharp
public DropdownField(List<string> choices, string defaultValue, Func<string, string> formatSelectedValueCallback = null, Func<string, string> formatListItemCallback = null)
```

### Parameters

**** (\[List\<string>]\(https\://learn.microsoft.com/dotnet/api/system.collections.generic.list-1)): The list of choices to display in the dropdown.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The default value selected from the dropdown.**** (\[Func\<string, string>]\(https\://learn.microsoft.com/dotnet/api/system.func-1)): Callback to format the selected value.**** (\[Func\<string, string>]\(https\://learn.microsoft.com/dotnet/api/system.func-1)): Callback to format the list items displayed in the dropdown.

## DropdownField(string, List\<string>, string, Func\<string, string>, Func\<string, string>)

Construct a DropdownField.

```csharp
public DropdownField(string label, List<string> choices, string defaultValue, Func<string, string> formatSelectedValueCallback = null, Func<string, string> formatListItemCallback = null)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The label to display in front of the field.**** (\[List\<string>]\(https\://learn.microsoft.com/dotnet/api/system.collections.generic.list-1)): The list of choices to display in the dropdown.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The default value selected from the dropdown.**** (\[Func\<string, string>]\(https\://learn.microsoft.com/dotnet/api/system.func-1)): Callback to format the selected value.**** (\[Func\<string, string>]\(https\://learn.microsoft.com/dotnet/api/system.func-1)): Callback to format the list items displayed in the dropdown.

## DropdownField(List\<string>, int, Func\<string, string>, Func\<string, string>)

Construct a DropdownField.

```csharp
public DropdownField(List<string> choices, int defaultIndex, Func<string, string> formatSelectedValueCallback = null, Func<string, string> formatListItemCallback = null)
```

### Parameters

**** (\[List\<string>]\(https\://learn.microsoft.com/dotnet/api/system.collections.generic.list-1)): The list of choices to display in the dropdown.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The index of the choice selected by default.**** (\[Func\<string, string>]\(https\://learn.microsoft.com/dotnet/api/system.func-1)): Callback to format the selected value.**** (\[Func\<string, string>]\(https\://learn.microsoft.com/dotnet/api/system.func-1)): Callback to format the list items displayed in the dropdown.

## DropdownField(string, List\<string>, int, Func\<string, string>, Func\<string, string>)

Construct a DropdownField.

```csharp
public DropdownField(string label, List<string> choices, int defaultIndex, Func<string, string> formatSelectedValueCallback = null, Func<string, string> formatListItemCallback = null)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The label to display in front of the field.**** (\[List\<string>]\(https\://learn.microsoft.com/dotnet/api/system.collections.generic.list-1)): The list of choices to display in the dropdown.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The index of the choice selected by default.**** (\[Func\<string, string>]\(https\://learn.microsoft.com/dotnet/api/system.func-1)): Callback to format the selected value.**** (\[Func\<string, string>]\(https\://learn.microsoft.com/dotnet/api/system.func-1)): Callback to format the list items displayed in the dropdown.
