> ## Documentation Index
> Fetch the complete documentation index at: https://luau.limerence.biz/llms.txt
> Use this file to discover all available pages before exploring further.

# Dropdown

> A list to pick from, single or multi select.

Also has everything from [ElementHandle](/ui/classes/element-handle).

A list to pick from. In single-select mode the value is one `string`; in multi-select mode it's a list of strings.

|                |                                                        |
| -------------- | ------------------------------------------------------ |
| **Value type** | `string` (single) or `{ string }` (multi)              |
| **Created by** | [Section:AddDropdown](/ui/classes/section#adddropdown) |

## Creation

```luau theme={null}
section:AddDropdown(key, label, options, default?)
```

<ParamField path="options" type="{ string }" required>
  The list of choices. Order is preserved.
</ParamField>

***

## SetOptions

```luau theme={null}
dropdown:SetOptions(options: { string }): ()
```

Change the list of choices.

***

## SetMode

```luau theme={null}
dropdown:SetMode(mode: "single" | "multi"): ()
```

Switch between single-select and multi-select.

***

## SetMin / SetMax

```luau theme={null}
dropdown:SetMin(min: number): ()
dropdown:SetMax(max: number?): ()
```

In multi-select, the smallest / largest number of choices the user must pick. `nil` removes the cap.

***

## SetPlaceholder

```luau theme={null}
dropdown:SetPlaceholder(text: string): ()
```

Text shown when nothing is selected.

***

## SetSelected

```luau theme={null}
dropdown:SetSelected(value: string | { string }): ()
```

Set the selection: a `string` in single mode, a list in multi.

***

## Toggle

```luau theme={null}
dropdown:Toggle(option: string): ()
```

In multi mode: add or remove that option. In single mode: pick it and close.

***

## IsSelected

```luau theme={null}
dropdown:IsSelected(option: string): boolean
```

***

## Open / Close

```luau theme={null}
dropdown:Open(position: UDim2?): ()
dropdown:Close(): ()
```

Open or close the popup from code.

***

## WasJustClosed

```luau theme={null}
dropdown:WasJustClosed(): boolean
```

True for about 0.1s after the dropdown closed. Use this to swallow the click that just dismissed it.

## Example

```luau theme={null}
local lang = section:AddDropdown("lang", "Language", { "EN", "FR", "DE" }, "EN")
lang:SetMode("multi")
lang:OnChange(function(sel)
    print("selected:", sel)
end)
```
