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

# Check Box Element

> Check Box Element — CometChat documentation.

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

### Constructor

| Name             | Type                 | Description                               |
| ---------------- | -------------------- | ----------------------------------------- |
| **elementId**    | string               | Used to set unique ID for the element     |
| **label**        | string               | Used to set a label for the element       |
| **options**      | List\<OptionElement> | Used to set options for the element       |
| **optional**     | bool                 | Used to set optional flag for the element |
| **defaultValue** | String               | Used to set default value for the element |

***

### Usage

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

<Tabs>
  <Tab title="Dart">
    ```dart theme={null}
    CheckBoxElement(
        elementId: "service",
        label: "Select Services",
        defaultValue: ["pool"],//optional
        options: [
            OptionElement(label: "pool",value: "pool" ),
            OptionElement(label: "gym",value: "gym" ),
            OptionElement(label: "garden",value: "garden" ),
        ]
    )
    ```
  </Tab>
</Tabs>

In this example, a new instance of `CheckboxElement` is created with an elementId "service", a label "Select Services", and a list of three options.
