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

# Dropdown

> String selection control with a configurable list of options

A **Dropdown** presents the operator with a fixed list of string options. When the operator selects an item, Blueprint receives the selected string through a bound event.

***

## Configuration

Dropdowns are declared inside `UICategories` on the `xrlive_UIpanel` component. Set **Type** to `Xrlive Dropdown` and fill in the fields below.

| Field                | Type            | Description                                                                                                                                |
| -------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| **Name**             | String          | Unique ID of the control. Must match exactly (case and spaces) when referenced in Blueprint.                                               |
| **Tooltip**          | String          | Optional helper text shown to the operator on hover.                                                                                       |
| **Dropdown Options** | Array of String | The list of selectable options. Each entry is a string typed manually. Add as many options as needed.                                      |
| **Selected Item**    | String          | The option that is active when the visual loads. Must match one of the entries in **Dropdown Options** exactly — same casing, same spaces. |

<Warning>
  If **Selected Item** is left empty or does not match any entry in **Dropdown Options**, the dropdown will start with no selection at runtime. Always verify that the value is an exact match of one of the declared options.
</Warning>

***

## Blueprint API

Call `Find Control by Name` on the `xrlive_UIpanel` reference, passing the dropdown's **Name**. Feed the **Return Value** into `Bind Event to On Dropdown Selection`. Create a **Custom Event** and connect it to the **Event** pin.

<Frame caption="Dropdown wiring — Find Control by Name feeds Bind Event to On Dropdown Selection; Selected Item is routed into a Switch on String to branch per option">
  <img src="https://mintcdn.com/xrlive/0lHBZ3qoAiwMfyj9/images/sdk/ui-components/dropdown-bind-event.png?fit=max&auto=format&n=0lHBZ3qoAiwMfyj9&q=85&s=edb93e9b3ff849d62301f522e0e2d955" alt="Blueprint graph showing Xrlive Ulpanel reference connected to Find Control by Name, whose Return Value feeds the Target pin of Bind Event to On Dropdown Selection. A Custom Event node named OnDropdownSelection_Event exposes Control Name and Selected Item output pins. The Selected Item pin connects to a Switch on String node with Option 1, Option 2, Option 3, and Default output pins." width="800" height="436" data-path="images/sdk/ui-components/dropdown-bind-event.png" />
</Frame>

The custom event exposes two output pins:

| Pin               | Type   | Description                                                                                      |
| ----------------- | ------ | ------------------------------------------------------------------------------------------------ |
| **Control Name**  | String | The name of the dropdown that fired the event. Useful when one event handles multiple dropdowns. |
| **Selected Item** | String | The string value of the option the operator selected.                                            |

<Tip>
  Each option in a dropdown typically drives a different behavior, so it is common to route **Selected Item** into a `Switch on String` node and handle each case in its own branch. This is a recommendation, not a requirement — how the selected value is consumed is entirely up to the developer.
</Tip>

***

## Populating options at runtime

If the list of options needs to be built dynamically — for example, from a data table or an external source — you can populate the dropdown at runtime using `Set Dropdown Options By Name` instead of, or in addition to, the static **Dropdown Options** array in `UICategories`.

<Frame caption="Set Dropdown Options By Name — populates the dropdown list at runtime">
  <img src="https://mintcdn.com/xrlive/0lHBZ3qoAiwMfyj9/images/sdk/ui-components/dropdown-set-options.png?fit=max&auto=format&n=0lHBZ3qoAiwMfyj9&q=85&s=9c6c068d99571d99e2c39f88de0bc301" alt="Blueprint graph showing Xrlive Ulpanel reference connected to Set Dropdown Options By Name. The node exposes Control Name, First Item, Options (array), and Overwrite if Not Empty input pins, and a Return Value output pin." width="613" height="342" data-path="images/sdk/ui-components/dropdown-set-options.png" />
</Frame>

| Pin                        | Type            | Description                                                                                                                                                                                                                |
| -------------------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Control Name**           | String          | The name of the dropdown to populate. Must match the control's **Name** field exactly.                                                                                                                                     |
| **First Item**             | String          | The option that will be selected by default once the list is applied.                                                                                                                                                      |
| **Options**                | Array of String | The full list of options to load into the dropdown.                                                                                                                                                                        |
| **Overwrite if Not Empty** | Bool            | When `true`, the runtime list replaces any options already declared in `UICategories`. When `false`, the static list in `UICategories` takes priority and the runtime list is ignored if the dropdown already has options. |
