> ## Documentation Index
> Fetch the complete documentation index at: https://cometchat-22654f5b-docs-audit-mechanical-fixes.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# DropDown Element

> DropDown Element — CometChat documentation.

The `DropDownElement` class is utilised to create a single selection input element in a user interface.

### Properties

| Name             | Type              | Description                                  |
| ---------------- | ----------------- | -------------------------------------------- |
| **elementId**    | `string`          | Used to set a unique ID for the element      |
| **label**        | `string`          | Used to set a label for the element          |
| **options**      | `[OptionElement]` | Used to set options for the element          |
| **optional**     | `bool`            | Used to set an optional flag for the element |
| **defaultValue** | `String`          | Used to set a default value for the element  |

### Usage

Here's how to create an instance of the `DropDownElement` class:

<Tabs>
  <Tab title="Swift">
    ```swift theme={null}
    let option1 = OptionElement()
    option1.id = "A"
    option1.value = "B"
    let option2 = OptionElement()
    option2.id = "B"
    option2.value = "A"
    let dropdownElement = DropdownElement()
    dropdownElement.elementId = "Block"
    dropdownElement.label: "Select block"
    dropdownElement.options: [option1,option2]
    ```
  </Tab>
</Tabs>
