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

# Check Box Element

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

### Parameters

| 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 `CheckboxElement` class:

<Tabs>
  <Tab title="Swift">
    ```swift theme={null}
    let option1 = OptionElement(label: "pool",value: "pool" ),
    let option2 = OptionElement(label: "gym",value: "gym" ),
    let option3 = OptionElement(label: "garden",value: "garden" )
    let checkBoxElement = CheckBoxElement()
    checkBoxElement.elementId = "service"
    checkBoxElement.label = "Select Services"
    checkBoxElement.defaultValue = ["pool"]//optional
    checkBoxElement.options = [option1,option2,option3]"
    ```
  </Tab>
</Tabs>
