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

# Checkbox

```
DBD.formTypes.checkbox(disabled),
```

<ParamField path="disabled" type="boolean" required>
  Indicate if the checkbox should be disabled or not.
</ParamField>

## Data required for getActualSet function

Boolean, to be checked or not.

**Important:**

Please note that `if(saved.state)` will return false if data is not set. If you want to default state to be true, use this:

```javascript theme={null}
getActualSet: ({ guild, user }) => {
  return SAVED_STATE == null || SAVED_STATE == undefined
    ? DEFAULT_STATE
    : SAVED_STATE;
};
```

## Data returned

Boolean, true if ckecked – false if unchecked.

## Example Usage

```javascript theme={null}
{
    optionId: 'switch_coffee',
    optionName: "Coffee switch",
    optionDescription: "Do you want coffee to be sent daily to you?",
    optionType: DBD.formTypes.checkbox(false),
    getActualSet: async ({guild}) => {
        const SAVED_STATE = checkboxData[guild.id];
        const DEFAULT_STATE = true;
        return (SAVED_STATE == null || SAVED_STATE == undefined) ? DEFAULT_STATE : SAVED_STATE;
    },
    setNew: async ({guild,newData}) => {
        checkboxData[guild.id] = newData;
        return;
    }
},
```

<img height="200" src="https://mintcdn.com/assistantscenter/e0fzjuWUPc5-sSJC/images/formtypes/dbd-checkbox.png?fit=max&auto=format&n=e0fzjuWUPc5-sSJC&q=85&s=dccefaf30e75c62fbed9b2eb7a234d54" data-path="images/formtypes/dbd-checkbox.png" />
