# Option group object

Groups option objects under a heading in a select menu or multi-select menu.

| | |
|---|---|
| **Used in** | [Select menu element](https://workstation.repzo.com/docs/developers/block-kit/elements/select-menu-element), [Multi-select menu element](https://workstation.repzo.com/docs/developers/block-kit/elements/multi-select-menu-element) |

## Usage

Use `option_groups` instead of `options` on a static select or multi-select menu. The menu shows each group's `label` above its options.

## Fields

| Field | Type | Description | Required? |
|---|---|---|---|
| `label` | [Text object](https://workstation.repzo.com/docs/developers/block-kit/objects/text-object) | A `plain_text` text object that defines the label shown above this group of options. Maximum length for the `text` in this field is 75 characters. | Required |
| `options` | Array of [Option object](https://workstation.repzo.com/docs/developers/block-kit/objects/option-object) | An array of option objects that belong to this group. Maximum of 100 items. | Required |

> **How Repzo Chat differs from Slack**
>
> - Options are counted across all groups: a static menu holds up to 100 options in total, and more returns a warning.
> - Option `value`s must be unique across all groups of the menu; a duplicate returns a warning.

## Examples

### A select menu with grouped options

```json
{
  "blocks": [
    {
      "type": "section",
      "text": {
        "type": "mrkdwn",
        "text": "Which product line is this deal for?"
      },
      "accessory": {
        "type": "static_select",
        "action_id": "product_line",
        "placeholder": {
          "type": "plain_text",
          "text": "Select a product line"
        },
        "option_groups": [
          {
            "label": {
              "type": "plain_text",
              "text": "Software"
            },
            "options": [
              {
                "text": {
                  "type": "plain_text",
                  "text": "CRM licences"
                },
                "value": "crm"
              },
              {
                "text": {
                  "type": "plain_text",
                  "text": "Point of sale"
                },
                "value": "pos"
              }
            ]
          },
          {
            "label": {
              "type": "plain_text",
              "text": "Services"
            },
            "options": [
              {
                "text": {
                  "type": "plain_text",
                  "text": "Onboarding"
                },
                "value": "onboarding"
              },
              {
                "text": {
                  "type": "plain_text",
                  "text": "Data migration"
                },
                "value": "migration"
              }
            ]
          }
        ]
      }
    }
  ]
}
```

## Related

- [Composition objects](https://workstation.repzo.com/docs/developers/block-kit/objects)
- [Block Kit overview](https://workstation.repzo.com/docs/developers/block-kit)
