ChipList

Holds a set of `https://developers.google.com/apps-script/reference/card-service/chip` objects that are displayed in a row, wrapping to the next line to
horizontal scrollable.

Available for Google Chat apps. In developer preview for Google Workspace add-ons.


> [!WARNING]
> **Developer Preview:** Available as part of the [Google Workspace Developer Preview Program](https://developers.google.com/workspace/preview), which grants early access to certain features.

<br />

```javascript
const chip = CardService.newChip();
// Finish building the text chip...

const chipList = CardService.newChipList()
                     .setLayout(CardService.ChipListLayout.WRAPPED)
                     .addChip(chip);
```

### Methods

| Method | Return type | Brief description |
|---|---|---|
| `https://developers.google.com/apps-script/reference/card-service/chip-list#addChip(Chip)` | `https://developers.google.com/apps-script/reference/card-service/chip-list#` | Adds a chip. |
| `https://developers.google.com/apps-script/reference/card-service/chip-list#addEventAction(EventAction)` | `https://developers.google.com/apps-script/reference/card-service/widget` | Adds the event action that can be performed on the widget. |
| `https://developers.google.com/apps-script/reference/card-service/chip-list#setId(String)` | `https://developers.google.com/apps-script/reference/card-service/widget` | Sets the unique ID assigned that's used to identify the widget to be mutated. |
| `https://developers.google.com/apps-script/reference/card-service/chip-list#setLayout(ChipListLayout)` | `https://developers.google.com/apps-script/reference/card-service/chip-list#` | Sets the chip list layout. |
| `https://developers.google.com/apps-script/reference/card-service/chip-list#setVisibility(Visibility)` | `https://developers.google.com/apps-script/reference/card-service/widget` | Sets the visibility of the widget. |

## Detailed documentation

### `addChip(chip)`

Adds a chip.

#### Parameters

| Name | Type | Description |
|---|---|---|
| `chip` | `https://developers.google.com/apps-script/reference/card-service/chip` | The chip to add. |

#### Return


`https://developers.google.com/apps-script/reference/card-service/chip-list#` --- This object, for chaining.

*** ** * ** ***

### `addEventAction(eventAction)`

Adds the event action that can be performed on the widget.

#### Parameters

| Name | Type | Description |
|---|---|---|
| `eventAction` | `https://developers.google.com/apps-script/reference/card-service/event-action` | The `https://developers.google.com/apps-script/reference/card-service/event-action` to be added. |

#### Return


`https://developers.google.com/apps-script/reference/card-service/widget` --- The Object, for chaining.

*** ** * ** ***

### `setId(id)`

Sets the unique ID assigned that's used to identify the widget to be mutated. Widget mutation
is only supported in Add-Ons.

#### Parameters

| Name | Type | Description |
|---|---|---|
| `id` | `String` | The id of the widget, with a limit of 64 characters and in format of \`\[a-zA-Z0-9-\]+\`. |

#### Return


`https://developers.google.com/apps-script/reference/card-service/widget` --- This object, for chaining.

*** ** * ** ***

### `setLayout(layout)`

Sets the chip list layout. If unset, it defaults to `https://developers.google.com/apps-script/reference/card-service/chip-list-layout#WRAPPED` layout.

```javascript
const chip = CardService.newChip();
// Finish building the text chip...

const chipList =
    CardService.newChipList()
        .setLayout(CardService.ChipListLayout.HORIZONTAL_SCROLLABLE)
        .addChip(chip);
```

#### Parameters

| Name | Type | Description |
|---|---|---|
| `layout` | `https://developers.google.com/apps-script/reference/card-service/chip-list-layout` | The chip list layout. |

#### Return


`https://developers.google.com/apps-script/reference/card-service/chip-list#` --- This object, for chaining.

*** ** * ** ***

### `setVisibility(visibility)`

Sets the visibility of the widget. The default value is \`VISIBLE\`.

#### Parameters

| Name | Type | Description |
|---|---|---|
| `visibility` | `https://developers.google.com/apps-script/reference/card-service/visibility` | The `https://developers.google.com/apps-script/reference/card-service/visibility` of the widget. |

#### Return


`https://developers.google.com/apps-script/reference/card-service/widget` --- The Object, for chaining.